Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Grand total on matrix not calculated correctly

Hello All,

 

The grand total of my matrix is incorrect:

 

 

This is my dax for the revenue: 

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

  • Hi,

    Does this work?

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