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
Grizzlydad
Helper I
Helper I

DAX Measure Error In One Row In A Matrix

Hiya I have written a measure to calculate the time saved by "NILO" compared to "Region" and all seems well in the visual except in the month of June when the calculated difference is incorrect?
 
Here is the measure
 
NILO Saving (Minutes) = CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), Tbl_NationalRawData[Region Responded]= "REGION" ) - CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), Tbl_NationalRawData[NILO Responded]= "NILO" )
 
The matrix uses the following data but in the row for June, the calculation is wrong.
Month  NILO   Region
July       295      102
June      105      572   
May       88       190
April     169      344
March   155     104
The NILO Saving figure for June in the matrix visual returns 559 when it should be 467 (essentially the difference between the two). The visulisation rows use Month and the Value is NILO Saving (Minutes), which is the measure.
All the other months return the correct difference in figures except June?
I have multiple tabs using the same matrix for each region and each one has the wrong difference beingreturned for June only.
Can anyone help out please?
 
Thanks
 
Andrew
 
 
 
 

 

 

 
 
7 REPLIES 7
AntrikshSharma
Community Champion
Community Champion

Can you provide the PBIX file? without that it is difficult to tell why you get the error.

Grizzlydad_0-1597765108466.png

 

Hi @Grizzlydad ,

 

Try Troubleshooting your measures

 

Create Measures

 

Measure 1 Region = CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), Tbl_NationalRawData[Region Responded]= "REGION" )

 

Measure2 NILO = CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), Tbl_NationalRawData[NILO Responded]= "NILO" )

 

Difference = Measure 1 Region  - Measure2 NILO

 

 

See what values are returned by all these 3 measures separately.

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Spoiler
Hi

Where do you want me to try this troubleshooting, I don't understand?

Hi @Grizzlydad ,

 

Have you created these measures.

 

Not against the Month Column in the Visualization Pane, what is the value of thes measures.

 

1.jpg

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Pragati11
Super User
Super User

Hi @Grizzlydad ,

 

Try modifying your DAX expression as follows:

NILO Saving (Minutes) = CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), FILTER(ALLSELECTED(Tbl_NationalRaw), Tbl_NationalRawData[Region Responded]= "REGION" )) -

CALCULATE ( SUM ( Tbl_NationalRawData[Minutes Taken To Respond]), FILTER(ALLSELECTED(Tbl_NationalRaw), Tbl_NationalRawData[NILO Responded]= "NILO" ))

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi thanks, that has made each month have the same total now which is the total minutes saved year to date, not individual month totals.

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.