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
masthealth
Frequent Visitor

DAX Measure - Difference from overall

Hello PowerBI Community -

 

I have been going around in circles and may just be overthinking this issue.  I come from a relationship SQL world so still struggling with DAX a bit.  I have a matrix with a few measures and would like to calculate a 'difference from overall' for the 'Payer Group' below.

 

Here are my definitions:

Calculation 2017 = CALCULATE([Yield 365 All], year(Discharge[Discharge Date]) = 2017)

2017 Overall Avg = CALCULATE([Calculation 2017],ALL(Discharge),Discharge[Discharge Date].[Year]=2017)

Difference 2017 from Avg = [Calculation 2017] - [2017 Overall Avg]

 

This problem is with the '2017 Overall Avg' measure - it should be at 103.41%, just like the footer of the matrix but it's showing 89.35%.

 

How can I calculate the overall total for the year, and reuse it to do the difference calculation by the category shown?

 

Thank you!

 

Greenshot 2018-02-16 16.09.23.png

2 REPLIES 2
MarkLaf
Solution Sage
Solution Sage

The following might work:

 

2017 Overall Avg = CALCULATE([Calculation 2017],ALLEXCEPT(Discharge,Discharge[Discharge Date]))

If there are additional filters you want to maintain, just add column to ALLEXCEPT function.

 

Alternatively, you can use ALL but just on the Payer Group column.

Thank you MarkLaf.

 

The ALLEXCEPT on [Discharge Date] revision gave the same 89.3% result.

 

But then I tried the following at your suggestion:

 

2017 Overall Avg = CALCULATE([Calculation 2017],ALL((Discharge[Payer Group])))

 

And now I'm showing 103.55%.  Still not the 103.41% but ALOT closer and maybe just a precision issue.

 

 

Thanks!

 

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.