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

DAX to mask

Hi everyone,

 

I am using the following DAX to mask earners < 5.

 

Count Masked =
VAR GetCount =
    COUNTROWS(CCMP)
RETURN
    IF ( AND ( GetCount < 5, GetCount > 0), "*", GetCount)
 
 
quipmaster_0-1681448152051.png

 

My goal is to adapt the DAX to my use case - maintain the totals but mask any values less than 5. 

 
However, every value has an asterisk. I only want an asterisk to mask a value of less than 5. Please see attached file. 

 

CCMP_Mask_TEST.pbix

 

Any nudge is greatly appreciated. This is fake data but the problem is real. 

 

Luis

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

The measure is fine, but when you go down to the granularity of campus and certification there is only 1 row in the table for each combination, so countrows returns 1 and everything gets masked. To see a mix of masked and non-masked values you would need to go to a higher granularity.

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

The measure is fine, but when you go down to the granularity of campus and certification there is only 1 row in the table for each combination, so countrows returns 1 and everything gets masked. To see a mix of masked and non-masked values you would need to go to a higher granularity.

Anonymous
Not applicable

Hi @johnt75 ,

 

Thank you! I should have realized that this is summarized data. 

 

Your nudge helped me figure out the DAX.

 

Count Masked =
VAR GetCount =
    SUM(CCMP[Earners])
RETURN
    IF ( AND ( GetCount < 5, GetCount > 0), "*", GetCount)

 

 

quipmaster_0-1681530501748.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.