Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
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.
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.
Solved! Go to Solution.
Found the problems. I should have used 'and' instead of 'or'
Found the problems. I should have used 'and' instead of 'or'
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
6 | |
6 | |
5 | |
5 |
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |