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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. 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 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors