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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
akhaliq7
Post Prodigy
Post Prodigy

Case statement in power query but with a greater than operator

Trying to implement the following in power query, I tried adding a conditional column but don't know how to get it to work with a greater than operator.

 

case

     when column1 >= 20

     and column1 <= 100

     and column2 = 'N' then 1

     else 0

end as column

1 ACCEPTED SOLUTION
akhaliq7
Post Prodigy
Post Prodigy

I got it to work:  Add column -> custom column, use the following formula:

if [column1] >= 20 and [column1] <= 100 and [column2] = "N" then 1 else 0

if column1 is a text datatype then you need to surround the value with double quotes

View solution in original post

1 REPLY 1
akhaliq7
Post Prodigy
Post Prodigy

I got it to work:  Add column -> custom column, use the following formula:

if [column1] >= 20 and [column1] <= 100 and [column2] = "N" then 1 else 0

if column1 is a text datatype then you need to surround the value with double quotes

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors