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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nunnc01
Helper I
Helper I

why does filtering for 0 includes nulls?

Hi,

 

I have a basic dataset where I wish to count how many records have a certain number in a specific column. 

 

I am using the formula:

 

# mymeasure = CALCULATE([# Contacts Families],FILTER('FD_REQUEST_SUPPORT',' FD_REQUEST_SUPPORT'[Duration] = 0))

 

where:

# Contacts Families = COUNT('FD_REQUEST_SUPPORT'[Contact Group ID])

 

If i report on Working Days = 0 it is incorrectly including nulls in the calculation. For any other number I choose to report on it gives me the correct figure and doesn't include nulls. Why is Power BI treating 0 and null as the same thing??

 

I found this question previously posted https://community.powerbi.com/t5/Desktop/null-0/td-p/274809 where a solution is offered but I'm trying to understand why I need to specifically mention nulls in my measure. It seems like an error that nulls are being included in the first place.

 

When I display my data as a matrix the numbers shown are correct - clearly splitting the counts of nulls and 0. It's just in the measure that it seems to be showing them together.

 

Can anybody offer any assistance?

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

the equality between 0 and BLANK() has been a hassle for quite some time, but with the June 2019 release of Power BI Desktop there is a new operator == (indeed 2 equal signs, this means strict). Here you will find more information about this:

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-june-2019-feature-summary/#dax

Please be aware that this new operator is only available in Power BI (Desktop and Service), if you are using Analysis Services on-premises or on Azure, this will not work. Just upate to the latest version of Power BI Desktop: https://www.microsoft.com/en-us/download/details.aspx?id=45331

 

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

the equality between 0 and BLANK() has been a hassle for quite some time, but with the June 2019 release of Power BI Desktop there is a new operator == (indeed 2 equal signs, this means strict). Here you will find more information about this:

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-june-2019-feature-summary/#dax

Please be aware that this new operator is only available in Power BI (Desktop and Service), if you are using Analysis Services on-premises or on Azure, this will not work. Just upate to the latest version of Power BI Desktop: https://www.microsoft.com/en-us/download/details.aspx?id=45331

 

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks for the reply.

 

Still strange to me that in Power BI = doesnt deal with 0's and nulls independently. In Excel countif would have excluded nulls in this example.

 

At least the new DAX operator you mentioned appears to resolve the issue. At the moment, I can't see any reason why I wouldn't use == for all my calculations going forwards.

 

Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors