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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KA95
Helper III
Helper III

How do I return a 0 value if there are blank values in a column

Hi there, I have a measure that sums up a column and will only return one or two values depending on the IF statement, as you can see below:

Hidden Vacancies Rule = IF(sum(pro_vacancy[va_hidden]) >= 1, 0, 100)

 

If the value is greater than 1 then a score 0 will be returned, if it's less then 100 is returned. This is working correctly, however, the default is always a 100 if there are blank rows. 

 

I've tried adding a ISBLANK function but it won't allow me to reference the [va_hidden] column. 

How do I make the outcome 0 if there's no rows to sum in the [va_hidden] column?

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @KA95 ,

 

try like:

 

Hidden Vacancies Rule = IF(sum(pro_vacancy[va_hidden]) <= 1, 100, 0)

 

or 

 

Hidden Vacancies Rule = IF(sum(pro_vacancy[va_hidden]) >= 1 || ISBLANK(sum(pro_vacancy[va_hidden])), 0, 100)

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @KA95 ,

 

try like:

 

Hidden Vacancies Rule = IF(sum(pro_vacancy[va_hidden]) <= 1, 100, 0)

 

or 

 

Hidden Vacancies Rule = IF(sum(pro_vacancy[va_hidden]) >= 1 || ISBLANK(sum(pro_vacancy[va_hidden])), 0, 100)

Thank you @FreemanZ I initially tried the first one but that didn't work for some reason. It still took 100 as the default. 

But the second one worked! I need to practice how to use ISBLANK function more, cheers!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.