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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors