Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
hi @EmaVasileva
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
hi @EmaVasileva
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
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.
hi @EmaVasileva
could you please share your sample pbix file for us have atest, that will be a great help.
Regards,
Lin
Hi @ v-lili6-msft,
I resolved it. The issue was with the tables relationship. After edited it, both formulas worked:
Difference_2 = SUMX(VALUES('Table 2'[ID]),IF('Table1'[Income]-Table1'[Outcome]<0, ABS('Table1'[Income]-Table1'[Outcome],ABS('Table1'[Income]-Table1'[Outcome])) or
Difference2 = SUMX(VALUES('Table 2'[ID]), ABS('Table1'[Income]-Table1'[Outcome])
Thank you for the help and for the suggestions.
Best regards,
Ema
Gracias por la recomendación. Ya había perdido mucho tiempo y no encontraba la razón para que fallara el ABS, en mi caso de era el ABS(de dos medidas). Había que escribirlo a pie!!
@EmaVasileva what is the measure which you used for sum of income and outcome...I tried replicating your issue but worked fine
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.
@EmaVasileva 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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |