Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Nested IF statement in custom column

I'm relatively new to PowerBI and having a little trouble wih the syntax for transposing a nested IF statement from Excel. 

 

My Excel formula reads:

=IF(H2="NULL", "None" , IF(H2>B2,"Late", IF((I2<-7), "Early", "Good" )))

 

Trying to follow logic from previous posts, but seeminly always coming up with a syntax error.

 

Any help would be greatly appreciated!

 

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

You should provide some sample data in a format which people can copy, otherwise we are doing with our imagination...not sure if you want to add a custom column  in M or DAX, modify the Table name and Column name accordingly

here is M - Power Query Custom Column, you click Add Column -> Custom Column in GUI

Vera_33_0-1637551307100.png

if [H] = null then "None"
else if [H]>[B] then "Late"
else if [I] <-7 then "Early"
else "Good"

here is DAX Calculated column

Vera_33_1-1637551487688.png

Column = IF(ISBLANK([H]),"None",
IF([H]>[B],"Late",IF([I]<-7,"Early","Good")))

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Create a measure.

 

Measure = var null_ = IF(SELECTEDVALUE('Table'[H2])=BLANK(),"None",IF(SELECTEDVALUE('Table'[H2])>SELECTEDVALUE('Table'[B2]),"late",IF(SELECTEDVALUE('Table'[I2])<-7,"Early","Good")))
return null_

 

11.PNG

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

You should provide some sample data in a format which people can copy, otherwise we are doing with our imagination...not sure if you want to add a custom column  in M or DAX, modify the Table name and Column name accordingly

here is M - Power Query Custom Column, you click Add Column -> Custom Column in GUI

Vera_33_0-1637551307100.png

if [H] = null then "None"
else if [H]>[B] then "Late"
else if [I] <-7 then "Early"
else "Good"

here is DAX Calculated column

Vera_33_1-1637551487688.png

Column = IF(ISBLANK([H]),"None",
IF([H]>[B],"Late",IF([I]<-7,"Early","Good")))

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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