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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.