cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slackerhx Regular Visitor
Regular Visitor

Revising existing measure to be more dynamic

Hi All, 

 

I'm getting stuck in creating a more dynamic version of the following formula. 

 

I'm using the following measure as a filter on a map to identify which cities where 2 companies are present. 

 

Two clients in city = if(CALCULATE(DISTINCTCOUNT('Table 1'[Client Name]),values('Table 1'[City]),or('Table 1'[Client Name]="ABC",'Table 1'[Client Name]="XYZ"))=2,"Yes","No")
 
The measure works fine but it is not dynamic enough as I have to specify the names of the company in the measure and adjust the number of companies i need to look at accordingly (highlighted in RED). 
 
Is there any suggestion how to create a more dynamic version of this calculation where user can use a filter to select the names of the company and the number of companies present in the same city? 
 
Thank you. 
1 ACCEPTED SOLUTION

Accepted Solutions
slackerhx Regular Visitor
Regular Visitor

Re: Revising existing measure to be more dynamic

I manage to find the answer to my question above: 
 
if(CALCULATE(DISTINCTCOUNT('Table 1'[Client Name]),values('Table 1'[City]),ALLSELECTED('Table 1'[Client Name]))>1,"Yes","No")
1 REPLY 1
slackerhx Regular Visitor
Regular Visitor

Re: Revising existing measure to be more dynamic

I manage to find the answer to my question above: 
 
if(CALCULATE(DISTINCTCOUNT('Table 1'[Client Name]),values('Table 1'[City]),ALLSELECTED('Table 1'[Client Name]))>1,"Yes","No")