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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Justas4478
Post Prodigy
Post Prodigy

Query does not fully function

Hi, I have this power query.
Table.AddColumn(#"Added 'Absolute Difference Qty(PIC)'", "Comment",
each if [#"Absolute Difference Qty(PIC)"] = null then "Empty Location"
else if [#"Absolute Difference Qty(PIC)"] = 0 then ""
else if [#"Absolute Difference Qty(PIC)"] > 0 or [#"Absolute Difference Qty(PIC)"] <= 30 then "Difference - 1 to 30 Picks"
else if [#"Absolute Difference Qty(PIC)"] > 30 or [#"Absolute Difference Qty(PIC)"] <= 60 then "Difference - 31 to 60 Picks"
else if [#"Absolute Difference Qty(PIC)"] > 60 or [#"Absolute Difference Qty(PIC)"] <= 90 then "Difference - 61 to 90 Picks"
else if [#"Absolute Difference Qty(PIC)"] > 90 then "Difference - 90+"
else "No result", type text)

These two lines eam to be working as intended:
each if [#"Absolute Difference Qty(PIC)"] = null then "Empty Location"
else if [#"Absolute Difference Qty(PIC)"] = 0 then ""

 

Then rest of the results are coming back as 1-30 
else if [#"Absolute Difference Qty(PIC)"] > 0 or [#"Absolute Difference Qty(PIC)"] <= 30 then "Difference - 1 to 30 Picks"

 

even tho they should be different range.
I can't spot any exact problem why results are all returned for 1-30 if statment.
Here is some example of results I get.

Justas4478_0-1747738144284.png

Anyone know where I made a mistake, I made simpler else if before and they had no problem.
Maybe I over complicated query is some way.

1 ACCEPTED SOLUTION
Justas4478
Post Prodigy
Post Prodigy

Found the problems. I should have used 'and' instead of 'or'

View solution in original post

1 REPLY 1
Justas4478
Post Prodigy
Post Prodigy

Found the problems. I should have used 'and' instead of 'or'

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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