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(income) & Sum(expenditure) ie( Income- Expenditure ) in the Row subtotal header

Thank you very much in advance, 

 

  • 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 )

3 Replies