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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
kelvin-lkhca
Helper I
Helper I

Why the DISTINCTCOUNT gives different number when Variable and non Variable setting

Hi All Experts,

 

Please find below the dataset, measures and the outcome of the distinctcount in the matrix table. I have posted the source file with the link at below. My question is why the 2 measures are giving different outcome in the matrix table given their Dax measure are the same, just that 1st one with Variable created and 2nd one is without the variable. shouldn't the logic or flow be the same for both measure?

Thank you for your kind coaching in advance.

 

 

Dataset

kelvinlkhca_1-1698807721435.png

 

Measure 1

kelvinlkhca_2-1698807745572.png

 

Measure 2

kelvinlkhca_3-1698807771472.png

 

Matrix Tables

kelvinlkhca_0-1698807653484.png

 

 

 

https://drive.google.com/drive/folders/1vkOBb92F3hLBzh-dBzKNES6TFaWp4oHZ?usp=sharing

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kelvin-lkhca , Please refer to this article from Radacad explaining how variable works.

 

https://radacad.com/caution-when-using-variables-in-dax-and-power-bi

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kelvin-lkhca , Please refer to this article from Radacad explaining how variable works.

 

https://radacad.com/caution-when-using-variables-in-dax-and-power-bi

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That is a nice post and clear explanation. Thanks a lot!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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