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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.