Forum Discussion
SUM the ABS total
Hi all,
I have a table with ID, Income and Outcome columns (both calculated measures), Difference (which is a calc.metric =ABS(Income-Outcome).
I'd like to show the Total Difference value and I need the actual sum ot the diff values (1754), but currently with my formula Difference = ABS(Income-Outcome) the total result in PBI is 1552.
Any ideas for a working measure?
Thank you.
hi Anonymous
This is a measure total problem, for your case, just add a new measure as below:
Measure = VAR _table = SUMMARIZE('Table1',[ID],"_value",[Difference]) RETURN SUMX(_table,[_value])Regards,
Lin
8 Replies
- 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/547907 - v-lili6-msft
Community Support
hi Anonymous
This is a measure total problem, for your case, just add a new measure as below:
Measure = VAR _table = SUMMARIZE('Table1',[ID],"_value",[Difference]) RETURN SUMX(_table,[_value])Regards,
Lin
- AnonymousNot applicable
Hi, v-lili6-msft
I tried this but my ID column come from a different table and I cannot use the suggested formula. Any ideas? And could you specify which value should I use in the "Value" part?
Also, the measures are calculate fields, not columns, and some functions don't work.
Thank you.- v-lili6-msft
Community Support
hi Anonymous
could you please share your sample pbix file for us have atest, that will be a great help.
Regards,
Lin
- AnonymousNot applicable
Anonymous what is the measure which you used for sum of income and outcome...I tried replicating your issue but worked fine
- AnonymousNot applicable
Hi @HusnaBanu413,
For the Income I used CALCULATE (SUM ( 'Table1'[Income]; For the Outcome is CALCULATE (SUM ( 'Table1'[Outcome]
The first formula, which I used Is Difference = ABS(Income-Outcome) > didn't work.
I tried with Difference_2 = SUMX(VALUES('Table 2'[ID]),IF('Table1'[Income]-Table1'[Outcome]<0, ABS('Table1'[Income]-Table1'[Outcome],ABS('Table1'[Income]-Table1'[Outcome])) > work only in some cases, where the Outcome is not 0.
Thank you.