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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

how to count distinct values in a column

HI I have a column with 2 different text values in, and i need to create a measure that can make a distinct count of these 2 values I have see the following https://community.powerbi.com/t5/Desktop/CALCULATE-count-of-several-text-values/m-p/33878/highlight/... But this is counting all the rows. I have tried to change it a bit, but no success
1 ACCEPTED SOLUTION
Anonymous
Not applicable

solved with the following

 

CountItem = CALCULATE (
    DISTINCTCOUNT (TblName[itemnumber] );TblName[Status]="Open")

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Worked perfectly! Thank you so much!

Anonymous
Not applicable

solved with the following

 

CountItem = CALCULATE (
    DISTINCTCOUNT (TblName[itemnumber] );TblName[Status]="Open")

 

Hi @Anonymous ,

 

I used the same DAX you posted, however I received a result of one when it should've been two. What am I doing incorrectly? Here is my DAX expression:

 

Count Words = CALCULATE(DISTINCTCOUNT(Sheet1[Description]),Sheet1[Description]="Gloves")
 
Regards,
Gus Dahu

 



 

This work with me In measure (correct value) but On column, it gives a wrong value , why ?

Framet
Resolver II
Resolver II

Hi,

 

Without seeing some example data this isn't all that clear. If you have two possible text values in a column then distinct count will only return 0,1,2 depending on your filters. Is this your desired result?

It might seem a bit obvious but does DISTINCTCOUNT([Your Column Name] return what you need?

Thanks

Thomas

Anonymous
Not applicable

Thanks. I came to this post looking for help finding the number of distinct values in a column and the DISTINCTCOUNT function did work for me.

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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