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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LTi
Frequent Visitor

struggling with else if function in power query

Good evening,

I've tried to create a test logic using an if then function. It is about the evaluation of the Value column. If this column contains the percentage value less than 50%, then "critical" should be output, if this value is greater than 50% but less than or equal to 70%, then "slightly critical" should be output otherwise OK. Unfortunately, the formula below does not work. Who can take a look at this and have a solution suggestion for me? Thanks in advance.

 

= if[#"value %"] <= 0,50 then "critical" else
if[#"value %"] > 0,50 and <=0,75 then "slightly critical" else "OK"

3 REPLIES 3
hashtag_pete
Helper V
Helper V

Hi LTi, 
you can paste this formular

= Table.AddColumn(#"ChangeTo PreviousStep", "Custom", each if [#"value %"] <= 0.5 then "critical" else if [#"value %"] <= 0.7 then "slightly critical" else "OK")

 

Best

hashtag_pete

 

PS: if successfull, please give kudos and mark as solution

ppm1
Solution Sage
Solution Sage

Please try this instead.

 

= if[#"value %"] <= 0,50 then "critical" else
if [#"value %"] > 0,50 and [#"value %"] <= 0,75 then "slightly critical" else "OK"

 

Pat

Microsoft Employee
LTi
Frequent Visitor

Hi Pat, thank you for your assistance but it still doesn't work.

Error: expected token: 'then'

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors