Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! 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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.