Forum Discussion
Create a bar chart from Multiple Columns
Hi, I have some columns like this:
| Application | Melbourne? | Sydney? | Brisbane? | New York? |
| Pacman | Yes | Yes | Yes | |
| Pinball | Yes | Yes | ||
| Space Invaders | Yes | Yes | ||
| Street Fighter | Yes | Yes |
I would like to create a bar chart/pie chart that shows Application by location. I'm still pretty new to Power BI, but I can't figure out how to do this. Alternatively, I can get the data like this:
| Application | Locations |
| Paman | Melbourne; New York |
| Pinball | Melbourne; Sydney |
| Space Invaders | Melbourne; Brisbane |
| Street Fighter | Sydney; New York |
But I don't know how to create the visualisations from this source either (which would actually be preferrable. Thanks so much for your help!
edit: Not sure who "accepted" this as a solution, but it is NOT solved.
Anonymous
The easiest way is to unpivot the city columns in Power Query. Select the query, select the "city" columns" and choose "unpivot columns" in the ribbon:
This will ransform the table to this structure, where you now have th cities as a column which you can use in the visuals as a field.
You can now create you visuals. For example:
5 Replies
- PaulDBrownCommunity Champion
Anonymous
The easiest way is to unpivot the city columns in Power Query. Select the query, select the "city" columns" and choose "unpivot columns" in the ribbon:
This will ransform the table to this structure, where you now have th cities as a column which you can use in the visuals as a field.
You can now create you visuals. For example:
- AnonymousNot applicable
Hi Paul,
Thanks for this. Is there any way to do this with the second table? I use a lot of fields that contain multiple values from "label-type inputs".
- Ashish_MathurSuper User
Hi,
In the query editor, rIght click on the heading of the second table and click on Split by delimiter. Select the delimiter as ; and under Advanced options, select split by rows. Click on Close and Apply.
- PaulDBrownCommunity Champion
Anonymous
If the suggestion solves your issue, could you kindly mark it as a solution? This helps others looking for similar solutions. If you need further help, let us know!
- v-cazheng-msftCommunity Support
Hi, Anonymous
Is your problem solved? If there some posts help, then you can consider marking them as solutions. If not, please provide more details about your issue.
Best Regards
Caiyun Zheng