Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
schwinnen
Helper V
Helper V

Calculated Column with multiple IF Else Then

I've searched for an answer to this, but haven't been able to find a solution.  

 

I need a statement that says:

IF [FIELD A] <-15 THEN "EARLY"

IF [FIELD A] >-15<15 THEN "ON-TIME"

ELSE "LATE"

 

In other words, I am looking at [FIELD A] .  I need a new column that will look at the value in [FIELD A] and give 3 results, depending on the value in [FIELD A] - "EARLY", "ON-TIME" OR "LATE".

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@schwinnen You can use a switch statement:

SWITCH(TRUE(),

[Field A] < -15,"Early",

[Field A] >= -15 && [Field A] < 15,"On Time",

"Late")

View solution in original post

v-yuta-msft
Community Support
Community Support

Hi schwinnen,

 

Yes, switch can do this, you can also create a calculate column using nested if() statement in DAX like pattern below:

 

Result =
IF (
    Table[FIELD] < -15,
    "EARLY",
    IF ( Table[FIELD] > -15 && Table[FIELD] < 15, "ON-TIME", "LATE" )
)

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi schwinnen,

 

Yes, switch can do this, you can also create a calculate column using nested if() statement in DAX like pattern below:

 

Result =
IF (
    Table[FIELD] < -15,
    "EARLY",
    IF ( Table[FIELD] > -15 && Table[FIELD] < 15, "ON-TIME", "LATE" )
)

Regards,

Jimmy Tao

Anonymous
Not applicable

@schwinnen You can use a switch statement:

SWITCH(TRUE(),

[Field A] < -15,"Early",

[Field A] >= -15 && [Field A] < 15,"On Time",

"Late")

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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