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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.