Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
Can I able to create a 100% stacked bar graph that includes a line as well
The table below
Many thanks
Solved! Go to Solution.
You'll need a measure like this one. In my case, Year is the x axis and the legend is Product Categories. This measure is in the values (and a different measure is in the line).
Pct of Year Total =
VAR thiscategory = [Total Sales]
VAR allcategory =
CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Category] ) )
RETURN
DIVIDE ( thiscategory, allcategory )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Yes. You can use a line and stacked chart with a measure that shows the % of total for that category instead of the actual values (so they all add to 1). You can add the actual values in the tooltip if needed.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat Thank you for your reply.
How can I write the measure to show the percentages oftotal? I am new to Power BI
You'll need a measure like this one. In my case, Year is the x axis and the legend is Product Categories. This measure is in the values (and a different measure is in the line).
Pct of Year Total =
VAR thiscategory = [Total Sales]
VAR allcategory =
CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Category] ) )
RETURN
DIVIDE ( thiscategory, allcategory )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
73 | |
65 |