Forum Discussion
Convert a single column to multiple table columns and create null values
- 9 months ago
hi BA_Pete
I have manage to solve my data issue - and this now allows me to now create the box & whisker plots in Excel 365 that I could straightforwardly created in Excel 2016.
I needed to modify the tables I appened together to create the data table I originally posted, by adding a "key" column.
My steps:
1) Create individual table of data for each series: Structure of Table as:
Key Hire Price 1
Tier05 100
2 Tier05 101 3 Tier05 124 4 Tier05 76 1 Tier06 90 2 Tier06 122 1a) Formula for key column is =COUNTIF($BL$18:BL18,BL18) where column BL is the "Hire" Column
2) Add table to power query
3) Add customer column called "Series Name", with value =specific series name (e.g. List)
4) Repeat for above steps for each required series and change customer column "Series Name" value to suit specific series (e.g. All or Ordered, or Rejected etc).
5) Add new query by combining exisitng query and append data. This create this data table, slightly modified from original post by the addition of the new "Key" column:
The addition of the "Key" column now allow for the table to split and then re-organised aligning all the "Key" 1s together, then 2s etc etc.
6) Merge columns ("Hire" and "Key" and pick a separator symbol, which is not in either "Hire" column values or or "Key" column values)
7) Pivot "Series Name" column, with "Value Column" set to the "Price" column and under Advanced options select "Don't Aggregate"
😎 Sort table by "Hire" column and then "Key" column, buffered table to ensure all rows are correctly sorted. Formula as
= Table.Buffer(Table.Sort(#"Pivoted Column",{{"Hire", Order.Ascending},{"Key", Order.Ascending}}))
9) Remove "Key" and "Merged" column.
10) Final table look like this:
11) Close and Load query to new sheet in excel.
Ah, Excel. I thought you were using this in Power BI.
Do you have an example of your required visual output and which columns/values in your desired output would populate each aspect of the B&W chart please? Not 100% sure I can help you to do it in Excel to be honest, but happy to take a look. Are you using/do you use the Excel Data Model at all?
Pete
hi BA_Pete
I have manage to solve my data issue - and this now allows me to now create the box & whisker plots in Excel 365 that I could straightforwardly created in Excel 2016.
I needed to modify the tables I appened together to create the data table I originally posted, by adding a "key" column.
My steps:
1) Create individual table of data for each series: Structure of Table as:
| Key | Hire | Price |
1 | Tier05 | 100 |
| 2 | Tier05 | 101 |
| 3 | Tier05 | 124 |
| 4 | Tier05 | 76 |
| 1 | Tier06 | 90 |
| 2 | Tier06 | 122 |
1a) Formula for key column is =COUNTIF($BL$18:BL18,BL18) where column BL is the "Hire" Column
2) Add table to power query
3) Add customer column called "Series Name", with value =specific series name (e.g. List)
4) Repeat for above steps for each required series and change customer column "Series Name" value to suit specific series (e.g. All or Ordered, or Rejected etc).
5) Add new query by combining exisitng query and append data. This create this data table, slightly modified from original post by the addition of the new "Key" column:
The addition of the "Key" column now allow for the table to split and then re-organised aligning all the "Key" 1s together, then 2s etc etc.
6) Merge columns ("Hire" and "Key" and pick a separator symbol, which is not in either "Hire" column values or or "Key" column values)
7) Pivot "Series Name" column, with "Value Column" set to the "Price" column and under Advanced options select "Don't Aggregate"
😎 Sort table by "Hire" column and then "Key" column, buffered table to ensure all rows are correctly sorted. Formula as
= Table.Buffer(Table.Sort(#"Pivoted Column",{{"Hire", Order.Ascending},{"Key", Order.Ascending}}))
9) Remove "Key" and "Merged" column.
10) Final table look like this:
11) Close and Load query to new sheet in excel.
- BA_Pete9 months agoSuper User
Hi pb296 ,
Cool, glad you got it sorted.
As v-kpoloju-msft said, I also appreciate you taking the time to update the thread with your discovered solution. Really helpful for future readers with the same issue 👍
Pete
- v-kpoloju-msft9 months agoCommunity Support
Hi pb296,
Thank you for the reply and glad to hear that you have managed to resolve the issue.
Adding the “Key” column and restructuring your tables in Power Query was an excellent approach this ensures each series aligns correctly for your Box & Whisker plots in Excel 365.
Appreciate your time and effort in updating the thread with your solution. Please accept your solution as an answer, so this will help other community members facing a similar issue.