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
DP2022
Frequent Visitor

Measure query - to remove duplicate entries and to count specific text values in another column

Hi there

I have a data set with one column with the name of companies and another column which states what size company they are i.e. Micro, Small, Medium or Large. In that column the responses are 

Micro: 1-9 

Medium: 50-249 

Small: 10-49

Large: 250+

 

The companies column contains duplicate entries. All in all my data set contains around 100 duplicates. 

 

I have created a measure which removes the duplicates, it takes the following form:

Measure 1 = DISTINCTCOUNT('Table Name'[Company Name])

 

I have created three further measures for Micro, Small and Medium taking the following form:

Micro = COUNTROWS(FILTER('Table Name', 'Table Name'[Company Size]= "Micro: 1-9"))

Small = COUNTROWS(FILTER('Table Name', 'Table Name'[Company Size]= "Small: 10-49"))
Medium= COUNTROWS(FILTER('Table Name', 'Table Name'[Company Size]= "Medium: 50-249"))


And I have created a further measure to add three up to leave me with SMEs. 
SME = [Micro]+[Small]+[Medium] 

I'm having trouble combining the distinct measure and the SME measure into one formula so that the duplicates are removed first and then with Small, Micro and Medium businesses are counted up so that those remaining count of companies will be SMEs only. 


Can anyone assist me in order to resolve this problem for me?


Thanks in advance!
DP





 

1 ACCEPTED SOLUTION
PC2790
Community Champion
Community Champion

Hey @DP2022 ,

 

If you are looking for a total distinct count of Micro, Medium & Small without any distinction, you can create a measure :

Measure 2 = Calculate(DISTINCTCOUNT(Table Name[Company Name]),Filter(Table Name,Table Name[Company Size] in {"Micro: 1-9","Small: 10-49","Medium: 50-249"}))

View solution in original post

2 REPLIES 2
PC2790
Community Champion
Community Champion

Hey @DP2022 ,

 

If you are looking for a total distinct count of Micro, Medium & Small without any distinction, you can create a measure :

Measure 2 = Calculate(DISTINCTCOUNT(Table Name[Company Name]),Filter(Table Name,Table Name[Company Size] in {"Micro: 1-9","Small: 10-49","Medium: 50-249"}))
DP2022
Frequent Visitor

@PC2790 
Thanks for the quick response, I've just applied your measure and it works perfectly! 

I appreciate your help!

DP

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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