Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

How do you calculate the difference between two 100% stacked bar charts in DAX?

I've got two charts 100% bar charts, one of which is just pulling a stated percentage for each activity, the other is summing the time spent on each activity and then it obviously splits it out to give a percentage of total.

However, I'm looking to provide a Clustered bar chart that will show the difference between the two numbers for each activity. I just can't get it to add up at all...

I managed to get within a few hundredths of a percent accuracy wise but clearly it's still wrong.. The column formula I used to get this was as follows:

Percentage Difference = CALCULATE(SUM('Response Data'[Time]),FILTER('Response Data','Response Data'[Clean Activity]=EARLIER('Response Data'[Clean Activity])))/CALCULATE(SUMX(ALL('Response Data'),'Response Data'[Time]),FILTER('Response Data','Response Data'[Clean Activity]=EARLIER('Response Data'[Clean Activity]))) - 'Response Data'[Target]

Clean Category is the activity

Time is Time spent doing activity

Target is the targeted percent of total time spent on said activity

Any advice is much appreciated.

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

could you provide a copy of your report? Or create sample report with the issue recreated, and share that?

 

Cheers,
Sturla

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors