Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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,
Solved! Go to Solution.
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 )
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 )
@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/547907
Also, MM3TR&R might help as well. Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 120 | |
| 95 | |
| 70 | |
| 69 | |
| 65 |