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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

If statement custom column

Hi guys,

 

I'm trying to create a new column where the output value is dependent on the numerical value in a different column. This is create a slicer that allow the user to choose between grouped ranges of values.

 

The query is as follows:

 

if [Score] <= 0.2499 then "Info"
else if [Score] >= 0.25 if [score]
else if [Score] >= 0.50 & [Score] <= 0.7499 then "Medium"
else if [Score] >= 0.75 & [Score] <= 0.899 then "High" else "Critical"

 

When this custom column is computed, the first line works (there are rows returning the 'info' value), however the output for the rest of the rows is an error.

 

an example of the error statement:

 

Expression.Error: We cannot apply operator & to types Number and Number.
Details:
Operator=&
Left=0.25
Right=0.454

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Nevermind, I fixed it; just got to replace '&' with 'and'

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

Good, remember AND operator is (&&) not just (&), and OR operator is (||).

 

Paul Zheng _ Community Support Team

Anonymous
Not applicable

Nevermind, I fixed it; just got to replace '&' with 'and'

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.

Top Solution Authors