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.
Hi all,
I'm trying to develop a combo chart that is essentially a 100% stacked bar chart + a line graph. I have looked at previous answers for this and they have suggested using the following measure calc for the 100% stacked bar chart:
100pct =
VAR Val1AllCats = CALCULATE( SUM( Table1[val1] ), ALL( Table1[cat] ) )
RETURN
DIVIDE( SUM( Table1[val1] ), Val1AllCats )
I believe in previous tests this used to work, but seems like this is no longer the case and I get 100% for each column series grouping of the bar, as opposed to the percentage break down of a 100% total. Any ideas on what this could be?
Solved! Go to Solution.
I actually resolved the issue myself after reviewing what was done in the dashboard. If you change the sort column of the category within the calculation to be a different field, it will nullify the context (e.g. I sorted the category field by 'category_sort_order' field). In order to remediate this I simply needed to add the sort_order field to the calculation as well.
100pct =
VAR Val1AllCats = CALCULATE( SUM( Table1[val1] ), ALL( Table1[cat], Table1[cat_sort_order] ))
RETURN
DIVIDE( SUM( Table1[val1] ), Val1AllCats )
I actually resolved the issue myself after reviewing what was done in the dashboard. If you change the sort column of the category within the calculation to be a different field, it will nullify the context (e.g. I sorted the category field by 'category_sort_order' field). In order to remediate this I simply needed to add the sort_order field to the calculation as well.
100pct =
VAR Val1AllCats = CALCULATE( SUM( Table1[val1] ), ALL( Table1[cat], Table1[cat_sort_order] ))
RETURN
DIVIDE( SUM( Table1[val1] ), Val1AllCats )
Hi,
Share the link from where i can download your PBI file.
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |