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
Aydeedglz
Helper V
Helper V

Count the accounts THAT have a blank value in Column B, C, D and F - DAX

Hi,

 

I am trying to calculate the number of accounts in my table that have a blank value in different columns, example:

AccountColumnAColumnBColumnCColumnDColumnEColumnF
1DCAUP BLACKX364
32ABDOWN2 Y789
85BC 3WHITEY 
5JFCDOWN1BLACKY456
6ITBDOWN1 X566
3CBA 2WHITEX921
1AL      
6KTBUP3WHITEX421
4JK UP WHITEX689
7LZ   BLACKY 
9IMCDOWN2 X674

 

The result that I want is 9, because 9 accounts have blank values, I don't want to se how many blanks, 19 would be wrong.

 

How can I make in DAX a measure that will calculate that? I was trying with this but is not working when soing the sum

 

d_HighestBlank_AccountOwner =
VAR BLANKA = COUNTBLANK(TABLE[COLUMNA])
VAR BLANKB = COUNTBLANK(TABLE[COLUMNB])
VAR BLANKC = COUNTBLANK(TABLE[COLUMNC])
VAR BLANKD = COUNTBLANK(TABLE[COLUMND])
VAR BLANKE = COUNTBLANK(TABLE[COLUMNE])
VARBLANKF = COUNTBLANK(TABLE[COLUMNF])
 
VAR IFBLANK =
IF( BLANKA <> 0, BLANKA) ||
IF( BLANKB <> 0, BLANKB) ||
IF( BLANKC <> 0, BLANKC) ||
IF( BLANKD <> 0, BLANKD) ||
IF( BLANKE <> 0, BLANKE) ||
IF( BLANKE <> 0, BLANKF) ||
 
Is there a DAX function that is equal as "Do this THAT contains..."?
1 ACCEPTED SOLUTION

Hi  @Aydeedglz ,

You can update the formula of measure [d_HighestBlank_AccountOwner] as below and check if it can achieve your requirement.

d_HighestBlank_AccountOwner =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Account] ),
    FILTER (
        'Table',
        'Table'[ColumnA] = BLANK ()
            || 'Table'[ColumnB] = BLANK ()
            || 'Table'[ColumnC] = BLANK ()
            || 'Table'[ColumnD] = BLANK ()
            || 'Table'[ColumnE] = BLANK ()
            || 'Table'[ColumnF] = BLANK ()
    )
)

vyiruanmsft_0-1705388738013.pngBest Regards

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

View solution in original post

4 REPLIES 4
gadielsolis
Super User
Super User

Hello @Aydeedglz ,

Please try the following DAX:

 

gadielsolis_0-1705005282467.png

If this works please mark this as accepted solution.

Hi, I am doing the same and is not working for me, the issue I think is that my table have more columns and rows, I need to count the Account column, not the whole table. I provided an example table but is much bigger becuase I can't share the original data.

How can instead of sumx the whole table, sum only the number of "account"?

I want the distinct count of the "account" column. How many distinct accounts have a blank in column a or b or c or d or e or f.

Hi  @Aydeedglz ,

You can update the formula of measure [d_HighestBlank_AccountOwner] as below and check if it can achieve your requirement.

d_HighestBlank_AccountOwner =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Account] ),
    FILTER (
        'Table',
        'Table'[ColumnA] = BLANK ()
            || 'Table'[ColumnB] = BLANK ()
            || 'Table'[ColumnC] = BLANK ()
            || 'Table'[ColumnD] = BLANK ()
            || 'Table'[ColumnE] = BLANK ()
            || 'Table'[ColumnF] = BLANK ()
    )
)

vyiruanmsft_0-1705388738013.pngBest Regards

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

This one worked! Really thanks for the help!

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.