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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Nested IF to create a column

I am trying to create a column using nested if statements but I get the following syntax error.

 

the original formula I want to replicate is:

 

=IFS(U11<2;"0-2";U11<4;"2-4";U11<6;"4-6";U11<8;"6-8";U11<=10;"8-10";U11>10;">10")

 

Thanks for help in advance.

 

Capture.PNG

 

 

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

Try using "Conditional Column" option in Power Query Editor. It should easily this.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

5 REPLIES 5
prakash11440278
Post Prodigy
Post Prodigy

Try to create new custom column in Query Editor, like below.

 

(IF([COMP SCRAP]<=2) THEN "0-2" ELSE
IF([Comp Scrap]>2 AND [Comp Scrap]<=4) THEN "3-4" 

ELSE "")

 

(IF (U11<2) THEN "0-2" ELSE
IF(U11<4) THEN "2-4" ELSE
IF(U11<6) THEN "4-6" ELSE
IF(U11<8) THEN "6-8" ELSE
IF(U11<=10) THEN "8-10" ELSE
IF(U11>10) THEN ">10" ELSE "")

Stachu
Community Champion
Community Champion

in DAX you can try wrapping the text in FORMAT function .e.g

FORMAT("0 - 2","")


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

PattemManohar
Community Champion
Community Champion

Try using "Conditional Column" option in Power Query Editor. It should easily this.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

Thanks for the quick response. This solved my problem. @PattemManohar I tried using the FORMAT but still got an error. Have you tried it? Thanks

Stachu
Community Champion
Community Champion

@Anonymous
I couldn't replicate your error, so I assumed FORMAT may help if for some reason your string is not considred text by PowerBI
this code works for me:

Column = IF([Comp Scrap]<= 2, "0 - 2",
    IF([Comp Scrap] > 2 && [Comp Scrap] <=4, "2 - 4",
        BLANK()
    ))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.