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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DP2022
Regular 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"}))

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

I appreciate your help!

DP

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.