DAX - Nested IFs

Excel Jason

New Member
Joined
Oct 17, 2022
Messages
30
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a DAX formula that's essentially performing two calculations; However, although both work separately, when combined the second formula seems to over-write the second.

1682722874061.png


The desired outcome: If Project Name = "OKC to FLC" check for the two stated service provides and result a "Y" or "N". IF NOT, perform an identical check for the "MID to JAL' project name and return a "Y" or "No". If a given line item does not fit in these two buckets, return a blank.

What I'm receiving is a result is correct "Y" and "N" separation for "MID to Jal" but the first logical check for "OKC to FLC" returns blanks when it should return a "Y" or "N".

I think some syntax error is over-writing the first logic and only returning the second. Thoughts?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Excel Formula:
=IF(IF([@projectname]="OKC to FLC",IF(OR([@serviceprovider]="BKOH",[@serviceprovider]="8KYL"),"N","Y"))="",IF([@projectname]="MID to JAL",IF(OR([@serviceprovider]="FTAN",[@serviceprovider]="FTAN"),"N","Y")))

1682946412147.png


right now you have IF([@projectname]="OKC to FLC",IF(OR([@serviceprovider]="BKOH",[@serviceprovider]="8KYL"),"N","Y"))="" as your first IF. this if will always be false as it will return N="" or Y="".

also it appears your second section of service provider is checking for the same value twice

try this to see if it gets the results you're looking for:
Excel Formula:
=IF(IF([@projectname]="OKC to FLC",IF(OR([@serviceprovider]="BKOH",[@serviceprovider]="8KYL"),"N","Y"),"")<>"",IF([@projectname]="OKC to FLC",IF(OR([@serviceprovider]="BKOH",[@serviceprovider]="8KYL"),"N","Y"),""),IF([@projectname]="MID to JAL",IF(OR([@serviceprovider]="FTAN",[@serviceprovider]="FTAN"),"N","Y"),""))
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top