Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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'
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |