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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors