cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

## Unexpected results with DAX ABS function

Dear Friends.

I need help on some issues that seem very basic but cause me some confusion. I have a column with decimal number type data and with positive and negative values. In order to make some squares with the data source, I have created a calculated column that simply gives me the absolute value of the previously mentioned column. What surprises me is that for some records both columns have different values.

Let's show some measures, formulas and data:

My table is called MA_TRANSACCION

1. Why do these differences occur between the two columns? The only difference I expected was in the sign of the amounts, but not in the amounts.

On the other hand, I have created a measure

With this measure the result is satisfactory. However, the surprise comes when I create a second measure.

What surprises me in this case is that despite the differences in signs in some registers, the total remains the same for both measures.

2. Why is the total of these two measures equal?

I hope somebody can help me.

Best Regards,

Francisco.

7 REPLIES 7
Anonymous
Not applicable
It's not possible to say what's going on without access to the data itself.
Employee

Please try this expression instead for your second measure.  Your current one is calculating the same SUM and then taking the absolute value.  This one will take the ABS on each row, and then sum the result of all those values.

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

It seems to me that your formula has an error and should be like this:

Cantidad_ABS_2 = SUMX(MA_TRANSACCION, ABS(MA_TRANSACCION[Cantidad]))), it means by taking the SUM out inside the ABS, otherwise the results are incorrect.

However, even so the problem is not solved and we go back to the problem raised in my first question, why does ABS change the value in some records?.

I'll leave you some pictures.

Results with the measure as you suggested it;

Result by taking out the SUM inside the ABS;

Employee

My bad on leaving the SUM inside the SUMX.  Silly mistake.  The issue you are seeing is weird.  Do some C_Numero values have multiple rows?  What if you try MIN or MAX to troubleshoot?

Regards,

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Super User

That doesn't match.  Are you sure you're looking at the right columns?

Excuse me. I has some problems with the translate. My english is not so good. I already fix that.

New Member

@bsmartbkind how you resolved it?

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors