cancel
Showing results for
Did you mean:
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

1 ACCEPTED SOLUTION
Super User

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

If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!

2 REPLIES 2
Super User

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

If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!

Super User

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

If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!

Announcements

#### Power BI September 2023 Update

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

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### 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!

#### 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