The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.