Forum Discussion
100% Stacked Column Chart as Line Chart
Hello,
I need help. I am trying to create a 100% Stacked Line Chart.
Essentially, I want a 100% Stacked Column Chart but with as a Line Chart. The legend also needs to be interchangeable as I will be creating multiple visualisations.
Example Data:
Axis is Year
Legend is Category
Value is Unknown Measure?
Any information would be beneficial. Thanks
6 Replies
- parry2k
Super User
Anonymous can you provide more details. It is not very clear what you are looking for. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 - AnonymousNot applicable
Thanks for the quick reply.
I want to see the category % on a line chart
Axis = Year
Legend = Category (Red Yellow Green)
Year Red Yellow Green Total 2016 2 = 50% 1 = 25% 1= 25% 100% 2017 1= 25% 2 = 50% 1= 25% 100% 2018 1= 33% 1 = 33% 1= 33% 100% But if I slice by category, I want to see.
Year Red Yellow Total 2016 2 = 66% 1 = 33% 100% 2017 1= 33% 2 = 66% 100% 2018 1= 50% 1 = 50% 100% I also need to be able to change the legend to something else, so no hard coding of the categories (e.g. "Red").
- parry2k
Super User
Anonymous try following measures and put % measure on line chart, with Year on x - axis and category on Legend
Sum = SUM ( Line[Value] ) Sum Category = CALCULATE( [Sum], ALLSELECTED( Line[Category] ) ) % = DIVIDE ( [Sum], [Sum Category] )In expression, change table and column name as per your data model. and change data type of % measure to %.
- AnonymousNot applicable
Ah yes, thats an easy way, but is there any way to use the Line(Category) as the legend, so I can drop in different categories using the same measure? It's this part that I cannot figure out.