Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Difference between two groups in ROW Sub Totals Matrix Table

Hello,  I want to put in the difference between two groups in the total header rather than a sum of groups in Row Subtotals  For example:  Below I want to take the difference between Sum(incom...
  • tamerj1's avatar
    4 years ago

    Hi Anonymous 

    please try

    =
    VAR Value = [Measure]
    VAR IncomeValue =
        CALCULATE ( [Measure], TableName[IEO] = "Income" )
    VAR ExpenditureValue =
        CALCULATE ( [Measure], TableName[IEO] = "Expenditure" )
    RETURN
        IF ( HASONEVALUE ( TableName[IEO] ), Value, IncomeValue - ExpenditureValue )