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

How to count blank row group by a specific field

Hello, 

 

I have the following table and I would like to calculate the number of blank invoice group by wbs1.  The expected result should be 2.  What's the good dax formula for that.

 

DateWBS1AccountInvoice
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEM-00002-001180-00 
2019-09-18GEP-00002-001180-00 
2019-09-18GEP-00002-001180-00 
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This measure works

=CALCULATE(DISTINCTCOUNT(Data[WBS1]),Data[Invoice]=BLANK())

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This measure works

=CALCULATE(DISTINCTCOUNT(Data[WBS1]),Data[Invoice]=BLANK())

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can try to use the following measure to meet your requirement:

 

Measure = 
COUNTROWS (
    FILTER (
        SUMMARIZECOLUMNS (
            'Table'[WBS1],
            "Max_Invoice", MAX ( 'Table'[Invoice] )
        ),
        [Max_Invoice]
            = BLANK ()
    )
)

 

1.jpg


Best regards,

 

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

Hi,

give this a try:

 

Count blank row =
SUMX (
    SELECTCOLUMNS (
        SUMMARIZE ( 'Table'; 'Table'[WBS1] );
        "Count"; IF (
            CALCULATE ( COUNTROWS ( 'Table' ); 'Table'[Invoice] = BLANK () ) > 0;
            1;
            0
        )
    );
    [Count]
)

 

Regards Frank AT

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.