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.
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 "-".
Many thanks in advance.
Solved! Go to Solution.
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
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
Many thanks, that worked perfectly
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
45 | |
31 | |
30 | |
18 | |
17 |