cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

0 not recognized as a number

I'm trying to do a command but I can't work out how to get it to recognise 0 as a number rather than a blank, the issue I have is I have both blanks and 0's in my column, this is my command:

 

Day Groups = IF('Claims Full + Complaints'[Days from Claim to Complaint]=BLANK(), "No Complaint",IF('Claims Full + Complaints'[Days from Claim to Complaint]=0,"Within 15 days", IF('Claims Full + Complaints'[Days from Claim to Complaint]<16,"Within 15 days", IF('Claims Full + Complaints'[Days from Claim to Complaint]<31,"Within 30 days", IF('Claims Full + Complaints'[Days from Claim to Complaint]<61,"Within 60 days", IF('Claims Full + Complaints'[Days from Claim to Complaint]>60,"Over 60 days"))))))
 
The result is both blanks and 0's come out as "No Complaints".
 
Hopefully someone can help? Thanks
1 ACCEPTED SOLUTION

In the first clause , remove the '= BLANK()' and put isblank before the column name (with brackets round the column)

View solution in original post

5 REPLIES 5
HotChilli
Super User
Super User

Use ISBLANK(column) rather than '= BLANK'

Anonymous
Not applicable

Sorry how do I work that into my command I already have? Thank you

In the first clause , remove the '= BLANK()' and put isblank before the column name (with brackets round the column)

Anonymous
Not applicable

Perfect thank you for your help 😊

.. by the way, although the code works, nested IFs like that are a nasty way to accomplish it. SWITCH is a much more readable way to go - like this:
Day Groups = SWITCH(
  TRUE(),
  ISBLANK( 'Claims Full + Complaints'[Days from Claim to Complaint] ), "No Complaint",
  'Claims Full + Complaints'[Days from Claim to Complaint] = 0, "Within 15 days",
  'Claims Full + Complaints'[Days from Claim to Complaint] < 16, "Within 15 days",
  'Claims Full + Complaints'[Days from Claim to Complaint] < 31, "Within 30 days",
  'Claims Full + Complaints'[Days from Claim to Complaint] < 61, "Within 60 days",
  "Over 60 days"
)

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors