Forum Discussion
Clustered chart based on multiple columns
Hi,
I am have encountered and issue and can't find a solution.
I created the following table in Power BI:
| 2018 | 2019 | 2020 | |
| Headlease Rent | 246 | 246 | 246 |
| Market Rent | 235 | 240 | 244 |
| Sublease Rent | 184 | 188 |
And I need the following chart (made in excel):
I am unable to set the clusters by year (multiple columns). So I want a split on x-axis by columns and legend by rows
Hi Krcmajster,
Please unpivot table in Query Editor mode.
Then, please [Type] to X-axis and place [Year] to chart legend.
Best regards,
Yuliana Gu
4 Replies
- HotChilliCommunity Champion
If you shape your data as 'Year', 'Headlease Rent', 'Market Rent', 'Sublease Rent'. It will go in a clustered column chart like you want it.
It's a small table so you can do that in Excel OR take what you already have and transpose it and add the year column.
Once you have the data re-shaped, pull Year into Axis and the 3 rent types into Value.
- v-yulgu-msftMicrosoft Employee
Hi Krcmajster,
Please unpivot table in Query Editor mode.
Then, please [Type] to X-axis and place [Year] to chart legend.
Best regards,
Yuliana Gu
- abner0Frequent Visitor
I have a large amount of data with thousands of rows that is linked to other measures and visualizations. I suppose unpivoting will affect all these data? Is there an alternative that will keep my data intact since unpivoting will cause thousands of columns?