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
MalcolmR
Regular Visitor

Pivot file count error when nulls present

I am a newbie to PBI.   I do use Tableau.

 

I use the following calculation to count the number of xyz records in xyz_total that have a score = or > 38.  I use Distinctcount on the Record id because the file is pivoted (Record Id is a unique identifier)

 

xyzall = CALCULATE(DISTINCTCOUNT(Output[Record Id]),FILTER(Output,Output[xyz_total] >= 38))
 
I now want a count of all the records in xyz_total column that are not blank.   Note:  a score can be 0.
A Distinct count of Record id includes the null records because the null is in xyz-total column
How do I do this
Many thanks in advance
 
 
 
 
 
 
 

 

1 ACCEPTED SOLUTION
visheshjain
Solution Supplier
Solution Supplier

Hi @MalcolmR,

 

You can use the BLANK() function in DAX along with the operator "==" which is strictly blank, which will ignore the 0s in your column and count the blanks.

You can use it in the another measure changing the condition in the filter argument of calculate.

 

Here is a link explaining the BLANK() function.

 

BLANK – DAX Guide

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



View solution in original post

2 REPLIES 2
visheshjain
Solution Supplier
Solution Supplier

Hi @MalcolmR,

 

You can use the BLANK() os ISBLANK() functions in DAX, this will igore the 0s in your column and count the blanks.

You can use it in the another measure changing the condition in the filter argument of calculate.

 

Here is a link explaining the BLANK() function.

 

BLANK – DAX Guide

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



visheshjain
Solution Supplier
Solution Supplier

Hi @MalcolmR,

 

You can use the BLANK() function in DAX along with the operator "==" which is strictly blank, which will ignore the 0s in your column and count the blanks.

You can use it in the another measure changing the condition in the filter argument of calculate.

 

Here is a link explaining the BLANK() function.

 

BLANK – DAX Guide

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



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.