Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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 8
Anonymous
Not applicable

@Pragati11 

 

I think I have solved it by using the following formula:

 

AbsBias = SUMX(VALUES('Table1'[SKU]),CALCULATE([AbsBias],ALL('Table1'[Category])))
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Can you share your calculation for Absolute difference please?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Ofc 🙂 @Pragati11 

 

Bias = CALCULATE(SUM('Table1'[Sales])-SUM('Table2'[Forecast]))

 

AbsBias = CALCULATE(ABS(SUM('Table1'[Sales])-SUM('Table2'[Forecast])))

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

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable


@Pragati11 wrote:

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

 



@Pragati11 wrote:

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

 


@Pragati11 

 

That just makes all of the values negative. 

Hi @Anonymous ,

 

I just realised I understood your query wrong.

 

What do you mean by this in your statement:

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?

 

I don't understand the colored section of your comment.

This is basically the table I tried to reproduce at my end:

dff1.png

 

Where in the above table are you expecting 33 as a total?

 

Also see the image below, is my understanding correct based on the data you are using:

Pragati11_0-1602174265319.png

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

@Pragati11 

 

So in the table you have created, the "Total" row is the "Category1" row in my table. 

Anonymous
Not applicable

@Pragati11 

 

In my visualization i've created i Matrix visual, where the SKU's are a part of the "Category". So the Category row is basically the total of the SKU's. Therefore the total of the AbsDif should be 33, as the category value is not relevant. 

 

Hope you understand 🙂

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.