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
Bokazoit
Continued Contributor
Continued Contributor

Measure to remove (empty) from Distinct count

I have this datamodel with cross filter set to Both way joins, since its a questionary with multiple choice answers. I find that data model as a solution in this forum:

 

Bokazoit_0-1648914032907.png

When I need to show the amount unique respondents to a question for a periode as shown in the figure below:

Bokazoit_1-1648914175449.png

I can use the filter 'Is not Blank' for the answer to the question, and I get the correct number. But is there filter in the measure I can use instead?

My measure is:

 

Unique respondents = DISTINCTCOUNT(FactHjertelinjen[HjertelinjenKey])
 
And as can be seen from the datamodel I have 6 questions with cross filter set to both way. The issue is that when somebody use 'Analyze in Excel' the measure shows a higher number and therefor the user has to add the question dimension to the filter and choose filter, then 'Does not contain' (empty)
 
I can understand why it works that way, but can't figure out the filter. I tried this:
 
Unique respondents =
CALCULATE(
DISTINCTCOUNT(FactHjertelinjen[HjertelinjenKey]),
FILTER(Question1,Question1[HjertelinjenKey] <> BLANK()))

But if I add the other 5 dimensions I removes a lot, so I would need something that says:
 
FILTER(DimQuestion1,DimHjertesygdom[HjertelinjenKey] <> BLANK())
OR
FILTER(DimQuestion2,DimHjertesygdom[HjertelinjenKey] <> BLANK())
OR
FILTER(DimQuestion3,DimHjertesygdom[HjertelinjenKey] <> BLANK())
OR
etc.
 
In the above Question1 is the filter 'Hvilken Hjertesygdom', meaning what heart disease
 
Any help is appreciated 💟
 
3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @Bokazoit 

 

Maybe we can think the other way around. Calculate the dictinct count of empty ones and the distinct count of all values in advance. Then substract the former one from the latter one. 

 

Best Regards,
Community Support Team _ Jing

Greg_Deckler
Community Champion
Community Champion

@Bokazoit Maybe:

Unique respondents = COUNTROWS(DISTINCT(FILTER(FactHjertelinjen,[HjertelinjenKey]<>BLANK())))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank You but that did not change anything

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.

Top Solution Authors