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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors