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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors