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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
common763
Helper III
Helper III

Measure-Distinct Count but giving specific category 0 and display other fields

A customer asked me to create a table that displays a variety of columns including one called recommendation.  They mentioned that one group which I will call AAA does not do recommendations but still wants the data to be displayed with an NA next to the measure for that group.  I spent some time adding ISBLANK, distinctcountblank etc and it isnt working which I know why, but need some help if anyone can throw their two cents in.  Here is the DAX Measure that is working properly with the exception that it is distinctly counting blank measures for AAA.  I need it to display NA for when AAA comes up, then function the way the measure is written when it doesnt.  Thanks. 

 

# RECS =
CALCULATE (
    DISTINCTCOUNT ( RECOMMENDATION ),
    ALLEXCEPT (TABLE, TABLE[REPORT_ID], TABLE[STATION])
)
1 ACCEPTED SOLUTION
Syk
Super User
Super User

Try an if statement (or a switch function).

Measure = if(MAX(Table[Group])="AAA","NA",{whatever calculation you need when the group IS NOT AAA})

View solution in original post

2 REPLIES 2
Syk
Super User
Super User

Try an if statement (or a switch function).

Measure = if(MAX(Table[Group])="AAA","NA",{whatever calculation you need when the group IS NOT AAA})

That worked.  Thanks.  Much appreciated.  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.