Forum Discussion

smiller's avatar
smiller
Frequent Visitor
2 years ago

Complicated AllSelected Countrows DAX

I am trying to come up with a a % ultimately. I have Customers, Orders, and Staff Name. All fields can be in the dataset more than once.  I am looking for a % of customers that shopped with each of my staff. I have 5 staff members and I want to know how many shopped all 5. My staff table has more than 5 staff members though because it has all my locations, so it is grouped on County and nicknamed. So for example 5 staff are in North and 3 staff are in South. So I want to find the % of customers that shopped all 5 staff in the North and then the % of customers that shopped all three staff in South for example. Staff changes so 5 and 3 are not constant, but the County grouping is.

 

So it looks something like: 

 

CustomeridA   customer nameA staffnameA

CustomeridA  Customer nameA staffnameB

CustomeridA   customer nameA staffnameC

CustomeridB   customer nameB staffnameA

CustomeridC  Customer nameC staffnameB

CustomeridC   customer nameC staffnameC

CustomeridC   customer nameC staffnameA

 

 

I am using direct query to my powerbi.

 
I had tried a few formulas, but they didn't taken into consideration the filter of the teams. And also wouldn't load in the calc. Any help would be appreciated.
 
Another example would be. Patients.  if Kevin Jones seen Doc A and B and Justin Barnet seen Doctors A., B,C,D assuming that doctors A.b.c,d were all my doctors 50% of the patients seen all the doctors. 
 
I am using a Date slicer and a Team slicer

2 Replies

  • smiller your question is really confusing (atleast to me), can you share what is the expected output and the logic?

    • Sjmiller's avatar
      Sjmiller
      Regular Visitor

      Example  would be 75% of my customers shopped/interacted  with every staff member on the north team.  

      you can also think of it as patients. Where 75% of patients seen every doctor on the north team.