Forum Discussion
Absolute Value
Hi there
I'm pretty new to PowerBI where I am currently in trouble in regard to calculating the absolute value of data fields.
My visualization currently looks like:
Product. Sales. Forecast. Dif. AbsDif
Category1 90 117 -27 27
SKU1. 1 0 1 1
SKU2 2 0 2 2
SKU3 87 117 -30 30
I have calculated/transformed the difference to absolute value, but I don't understand why the total AbsDif of the SKU's (category1) does not total 33?
Hope you can help.
8 Replies
- AnonymousNot applicable
I think I have solved it by using the following formula:
AbsBias = SUMX(VALUES('Table1'[SKU]),CALCULATE([AbsBias],ALL('Table1'[Category]))) - Pragati11Super User
Hi Anonymous ,
Can you share your calculation for Absolute difference please?
Thanks,
Pragati
- AnonymousNot applicable
Ofc 🙂 Pragati11
Bias = CALCULATE(SUM('Table1'[Sales])-SUM('Table2'[Forecast]))AbsBias = CALCULATE(ABS(SUM('Table1'[Sales])-SUM('Table2'[Forecast])))- Pragati11Super User
Hi Anonymous ,
As you want your totals to be affected by your absolute value, you can write your measure something as below:
AbsBias = CALCULATE(ABS(SUM('Table1'[Sales])-SUM('Table2'[Forecast]))) * (-1)
Check if this helps.
Thanks,
Pragati