cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## Sign dependency between IF Dax

Hello,

I created this calculated column. I have a problem because the sign of the second IF impacts the sign of the 3rd IF. I tried to work around by storing the second IF in a variable but nothing worked. How can I avoid that the sign of the second IF does not impact the 3rd.

When I change the sign of the second if, it also changes the sign of the last if...

New =
IF ('Table'[Step] = "Ouverture", CALCULATE([T (n-1) cumul], 'repository'[category] = "1 - Net ", 'Table'[Code]= "IFRS new"),

IF ('Table'[Step] <> "", -CALCULATE([T cumul], 'repository'[category] = "2 - Total", 'Table[Code] = "new"),

IF ('Table'[Step] <> "", CALCULATE([T cumul], 'repository'[category] = "3 - Cash Flows", 'Table'[Code] = "IFRS new") ) ) )

4 REPLIES 4
Super User

Can you share a screenshot and describe the business logic? I think I have not yet understood what you would like to achieve 🙂

 Also happily accepting Kudos 🙂

 Feel free to connect with me on LinkedIn!

 #proudtobeasuperuser

Frequent Visitor

When I add the - in front of the 2nd IF, it shows me the correct results in my table, but it affects the sign of my 3rd IF. This turns my result into a negative for me, when I want it to be positive.

Between the 2- and the 3-, some lines share common accounts, I don't know if this can be the cause

Super User

The if function works like this:

if ( Condition = TRUE, Result, AlternativeResult )

--> "if condition is true, return Resultl, else return AlternativResult"

In your case, I'd suggest this one here:

New =
IF ('Table'[Step] = "Ouverture", CALCULATE([T (n-1) cumul], 'repository'[category] = "1 - Net ", 'Table'[Code]= "IFRS new"),

IF ('Table'[Step] <> "", -CALCULATE([T cumul], 'repository'[category] = "2 - Total", 'Table[Code] = "new"),

CALCULATE([T cumul], 'repository'[category] = "3 - Cash Flows", 'Table'[Code] = "IFRS new") ) )

Does this work?

 Also happily accepting Kudos 🙂

 Feel free to connect with me on LinkedIn!

 #proudtobeasuperuser

Frequent Visitor

Thanks for your answer but it doesn't work. I can't change the sign of the 3rd IF, I tried to put an ABS() but my number remains negative as if I hadn't put anything.

Announcements

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

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

#### Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors