cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Helper II

Formula for nested ifs condition

Hi,

Would like to seek your help on the below.

if Priority = 2 hours, then Pass, if not 2 hours, then failed,

if Priority = 4 hours, then Pass, if not 4 hours, then failed

1 ACCEPTED SOLUTION
Solution Sage

Try this:

``````IF (
priority = "p1",
IF (
duration <= 2,
"Pass",
"Fail"
),
IF (
priority = "p2",
IF (
duration <= 4,
"Pass",
"Fail"
),
BLANK ()
)
)``````
5 REPLIES 5
Helper II

how about if priority and duration are on a different table?

Helper II

that worked. thank you very much. 🙂

Solution Sage

Hi there!

Try something like this:

``````SWITCH(
SELECTEDVALUE( Priority ),
"2 hours", "Pass",
"4 hours", "Pass",
"failed"
)``````

If your priority column is numeric then dont use double quotes.

Let me know if that helps!

Helper II

hi, in bo the formula should be:

if (priority = p1, then (if duration <= 2,  "pass", "fail") elseif (priority=p2, then (if duration >=4, "pass", "fail")

else "null"

Solution Sage

Try this:

``````IF (
priority = "p1",
IF (
duration <= 2,
"Pass",
"Fail"
),
IF (
priority = "p2",
IF (
duration <= 4,
"Pass",
"Fail"
),
BLANK ()
)
)``````

Announcements

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

Power BI Monthly Update - April 2024

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

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors