Forum Discussion
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
- tamerj1
Community Champion
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 ) - Greg_Deckler
Community Champion
Anonymous This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907Also, MM3TR&R might help as well. Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community
- AnonymousNot applicable
Hello,
thank you for picking up my question.
Im beginner to power bi, Could you please help me understand solve this particular problem,
I havent used the measure to calculate the column rather i used calculated column
My issue is, i would like to take difference between two groups rather than sum, avg, or stats calculations that is readily available.
to do so, if i have to write DAX, Could you please explain me where to write DAX & on which specification of matrix does it goes
Thank you