In PowerBI, I have a data table which includes a question column and an associated answer column. In the answer column there are a mixture of lists (lists may contain one or more answers) and non-list values.
The question column should be pivoted so that each question is a new column with the associated answers from the answer column. There are also a number of other columns in the data table I want to keep in the output data table.
Starting example data table format
Desired example data table format
Please see the answer below for the workaround I used.
The query was resolved as follows:
1/. Separate each question and answer combination in to their own dfs.
2/. Expand the lists (where present) in each new df.
3/. Pivot the fields in each df.
4/. Merge the separate dfs in to a common df using a shared key column (in this example the 'Code' column) keeping the relevant columns in the new common df.