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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Rockies_Skier
Regular Visitor

Custom Column if statements returning inconsistent results

I am attempting to create a custom column classifying count values into ranges of specified interest via the following:

 

 

if [count] = null then "< 2" else 

if [count] < 2 then "< 2" else 

if [count] >= 2 and [count] <= 3 then "2 - 3" else 

if [count] = 4 then "4" else 

if [count] >= 5 then "5 +" else ""

 

 

However, the results being returned are inconsistent at times. The vast majority of values are correctly assigned to the required ranges, but at times I am noticing counts of various amounts getting classified incorrectly such as 12 and 8 falling into "4" or a count of 8 falling into "2-3". 

 

I'm fairly new to PowerBI and am uncertain on the approach to take from here. 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

can you provide a picture of the data rows that get classified wrongly please?

 

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

can you provide a picture of the data rows that get classified wrongly please?

 

Thanks for the quick response, I found the real error I am seeing. The classifications from the query were indeed correct, but in a visual I am currently using the field is getting summarized incorrectly in the tooltips. Marked your response as the solution and pursuing the error I am seeing otherwise.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors