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! Learn more

Reply
Anonymous
Not applicable

COUNTA - Display "-" in place of blank values

Hi all, 

 

 

I have the following code (and several simialr) plugged into a matrix table:

NTF data total count (planned) =

COUNTA(‘data set 1’[1: Booking Solutions - 1: Planned])+

COUNTA(‘data set 1’[5: Document Management / File Sharing  - 5: Planned])+

COUNTA(‘data set 1’[6: Electronic / Card Payment  - 6: Planned])+

COUNTA(‘data set 1’[10: Human Resource Management HRM - 10: Planned])+

COUNTA(‘data set 1’[14: Server / Infrastructure  - 14: Planned])+

COUNTA(‘data set 1’[16: Software Hardware Upgrades - 16: Planned])+

COUNTA(‘data set 1’[22: Voice Over IP VoIP - 22: Planned])+

COUNTA(‘data set 1’[25: Website e-Commerce  - 25: Planned])


My question is, how would I get it to return blank measures as a "0" or "-". 

Capture.PNG

Many thanks in advance. 

1 ACCEPTED SOLUTION
MartynRamsden
Solution Sage
Solution Sage

Hi @Anonymous 

 

To return 0, you can simply add '+0' to the end of your DAX expression.

 

To return '-', you can use the following:

 

NTF data total count (planned) =
VAR DataCount =
    COUNTA ( 'data set 1'[1: Booking Solutions - 1: Planned] )
        + COUNTA ( 'data set 1'[5: Document Management / File Sharing  - 5: Planned] )
        + COUNTA ( 'data set 1'[6: Electronic / Card Payment  - 6: Planned] )
        + COUNTA ( 'data set 1'[10: Human Resource Management HRM - 10: Planned] )
        + COUNTA ( 'data set 1'[14: Server / Infrastructure  - 14: Planned] )
        + COUNTA ( 'data set 1'[16: Software Hardware Upgrades - 16: Planned] )
        + COUNTA ( 'data set 1'[22: Voice Over IP VoIP - 22: Planned] )
        + COUNTA ( 'data set 1'[25: Website e-Commerce  - 25: Planned] )
VAR Result =
    IF ( ISBLANK ( DataCount ), "-", DataCount )
RETURN
    Result​

 

Best regards,

Martyn

View solution in original post

2 REPLIES 2
MartynRamsden
Solution Sage
Solution Sage

Hi @Anonymous 

 

To return 0, you can simply add '+0' to the end of your DAX expression.

 

To return '-', you can use the following:

 

NTF data total count (planned) =
VAR DataCount =
    COUNTA ( 'data set 1'[1: Booking Solutions - 1: Planned] )
        + COUNTA ( 'data set 1'[5: Document Management / File Sharing  - 5: Planned] )
        + COUNTA ( 'data set 1'[6: Electronic / Card Payment  - 6: Planned] )
        + COUNTA ( 'data set 1'[10: Human Resource Management HRM - 10: Planned] )
        + COUNTA ( 'data set 1'[14: Server / Infrastructure  - 14: Planned] )
        + COUNTA ( 'data set 1'[16: Software Hardware Upgrades - 16: Planned] )
        + COUNTA ( 'data set 1'[22: Voice Over IP VoIP - 22: Planned] )
        + COUNTA ( 'data set 1'[25: Website e-Commerce  - 25: Planned] )
VAR Result =
    IF ( ISBLANK ( DataCount ), "-", DataCount )
RETURN
    Result​

 

Best regards,

Martyn

Anonymous
Not applicable

Many thanks, that worked perfectly

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.