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
Anonymous
Not applicable

Nulls in Power BI in Direct Query mode

Hi All,

 

I observed that Power BI included the count of Nulls when calculating the averages. What's more surprising is that, Power BI considers Nulls as 0 which is not correct first of all and this assumption by Power Bi resulted in erroneous average calculation results for us. 

 

Unfortunately, there is no isnull function available, we had to use apply the filter to ignore the 0s in the data (even though we didn't have any 0s) to take care of the Nulls. Since we use direct query mode, we can't change anything at the query level to manually replace nulls with other values or blanks.

 

Is there a better solution to this problem? Is Power BI coming up with something to address this?

 

Thank you,

Vidya

4 REPLIES 4
Levajar
Advocate II
Advocate II

Did you try below link ? 

https://docs.microsoft.com/en-us/dax/isblank-function-dax 

 

It has an example for one scenario : 

=IF( SUM(InternetSales_USD[SalesAmount_USD])= 0 , BLANK() , SUM(ResellerSales_USD[SalesAmount_USD])/SUM(InternetSales_USD[SalesAmount_USD]) )

Anonymous
Not applicable

Hi @Levajar 

 

We do not have any blanks in our data, only few nulls and since I mentioned before Power Bi was considering these nulls as zeroes we had incrrect averages. 

 

Thanks

 

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

By my tests, we could use ISBLANK function in direct query mode.

We could use ISBLANK function to filter the value is null and then calculate the average.

If you still need help, please share some data sample and your desired output so that we could help further on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello @v-piga-msft ,

 

When I tried to use the ISBLANK(), the result is empty. That's why we had to apply the filter to ignore the 0s in the data. In our case, it seems like Power BI is considering nulls as zeros which is not right. I will try to prepare the test data smaple for you if needed.

 

Thanks,

 

 

 

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.