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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DistinctCount with different outputs

Hi DAX experts,

 

I have a bit of a mystery. I get two different outputs using the same DAX formula in two different tables.

The Response ID the same data type used in two different tables.

 

DF_DIM has the data in unique, long format.

 

Survey_FACT has the data in many, long format.

 

Yet I get two competing outputs. Survey_Fact has the correct output. Would appreciate a nudge in troubleshooting why DF_DIM does not produce the correct output. 

 

Total DF =
DISTINCTCOUNT(DF_Dim[Response ID])
 
Total Responses = DISTINCTCOUNT('Survey Fact'[Response ID])
 
Here is the link to the dashboard and data. The Personal Information has been scrubbed. The response ID is an encrypted code. 
 
 
Correct ouput
 
quipmaster_0-1705965095928.png

 

Incorrect Frequency

quipmaster_1-1705965133325.png

 

Sincerely,

 

Luis Pablo Martinez

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

 

In Model view, change the cross filter direction from single to both

vjialongymsft_0-1705975577684.png

 

This is the result you want

vjialongymsft_1-1705975853528.png

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

You have guided me to the answer.

 

I created this measure that works well.

 

Total DF =
CALCULATE(
    [Total Responses],
    CROSSFILTER(DF_Dim[DF_ID], 'Survey Fact'[DF_ID], Both)
)
 
I read in Expert Modeling in Power BI by Soheil Bahkhshi and Definitive Guide to DAX by SQLBI to rarely use the bidirectional filter.
 
Instead to use the crossfilter() to avoid ambiguity.
 
Your response got me there.
 
Thank you.
Anonymous
Not applicable

Hi @Anonymous 

 

 

In Model view, change the cross filter direction from single to both

vjialongymsft_0-1705975577684.png

 

This is the result you want

vjialongymsft_1-1705975853528.png

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.