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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Narender
Resolver I
Resolver I

How to count distinct values ?

Hi All,

 

I want to calculate distinct count of my column in measure.

 

like:

 

Measure 2 = DISTINCTCOUNT((TAX_TRANSACTION[TAX_PAYER_NO]))

This showing wrong result as i compared with my sql query result.

 

Without distinct is showing right result

COUNT((TAX_TRANSACTION[TAX_PAYER_NO])) is showing right result as i compared with my sql query result.

 

Please let me know, how can i write expression in dax for distinct count??

 

 

Thanks

 

Narender

1 ACCEPTED SOLUTION
Narender
Resolver I
Resolver I

Hi All,

 I got the reason of wrong value.

 

Measure 2 = DISTINCTCOUNT((TAX_TRANSACTION[TAX_PAYER_NO]))

 

I was using 2 square brackets'(('  but I have to use 1 square bracket '('

 

 

 

Measure 2 = DISTINCTCOUNT(TAX_TRANSACTION[TAX_PAYER_NO]).

 

🙂

 

Thanks everyone.

 

Narender

View solution in original post

5 REPLIES 5
Narender
Resolver I
Resolver I

Hi All,

 I got the reason of wrong value.

 

Measure 2 = DISTINCTCOUNT((TAX_TRANSACTION[TAX_PAYER_NO]))

 

I was using 2 square brackets'(('  but I have to use 1 square bracket '('

 

 

 

Measure 2 = DISTINCTCOUNT(TAX_TRANSACTION[TAX_PAYER_NO]).

 

🙂

 

Thanks everyone.

 

Narender

@Narender,

 

By the way, you may help accept the solution above. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@Narender,

Do you have blank values in the column?  Those have an effect on the output and might be the reason for the difference...distinct.PNG

 

 

 

 

 

 

Br,

T

 

 

 

 

kaushikd
Resolver II
Resolver II

Hi

 

DISTINCTCOUNT() is the exact dax function for the scenario you explained, may be you are doing something wrong in either modelling.

 

walk through the example to have a brief idea about the result returned by DISTINCTCOUNT().

https://msdn.microsoft.com/en-us/query-bi/dax/distinctcount-function-dax

 

 

If still you face problem please attach the file or share it, we will look into the scenario.

 

Thejeswar
Super User
Super User

Hi,

Your DAX staement is correct. Ideally it should show the right values

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.