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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
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.