Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
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").
@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 %.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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.
@Anonymous not fully sure about your question, do you want different value x-axis and keep category on legend, is this what you are asking?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
No, I mean from this:
Sum = SUM ( Line[Value] )
Sum Category = CALCULATE( [Sum], ALLSELECTED( Line[Category] ) )
% = DIVIDE ( [Sum], [Sum Category] )
To this:
Sum = SUM ( Line[Value] )
Sum Category = CALCULATE( [Sum], ALLSELECTED( Whatever is in the legend ) )
% = DIVIDE ( [Sum], [Sum Category] )
Essentially I need the legend to be dynamic. The way I see it, the Axis and Value need to be the same but I need to be able to change the legend (category). As you can do in the 100% Stacked Column Chart, by just dragging in another column.
@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
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |