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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Grand total on matrix not calculated correctly

Hello All,

 

The grand total of my matrix is incorrect:

Capture.PNG

 

 

This is my dax for the revenue: 

Capture2 .PNG

Revenue = if(CONTAINS('Gp Cons P&L','Gp Cons P&L'[Item No],"4510003"),[CM Act]-[PYM],if(CONTAINS('Gp Cons P&L','Gp Cons P&L'[Item No],"4550003"),[CM Act]-[PYM],[CM Act]-[CM Act-LY FX]))
 
CM Act = CALCULATE(TOTALMTD(SUM('Gp Cons P&L'[Amount]),'Calendar'[Date]),'Gp Cons P&L'[Act/FC/B]="Actual")
[PYM] and [CM Act-LY FX] are also SUM functions
 
From what I have read, it has something to do with my DAX. How do I change my DAX to get a correct total?
 
Any tips would be very helpful  🙂
1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Does this work?

=IF(HASONEVALUE([Item No]),[Revenue],SUMX(SUMMARIZE(VALUES([Item No]),[Item No],"ABCD",[Revenue]),[ABCD]))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Users online (1,152)