Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filtering based on several columns

I have some data structured as below - rows are individuals; each individual can belong to one or more of teams A through D, and each invidual has a certain number of clients. I'd like to create a slicer that selects a team. Let's say I have a card which computed the average number of clients.

PERSONIDN_CLIENTSTEAM_ATEAM_BTEAM_CTEAM_D
16TRUETRUEFALSEFALSE
212FALSETRUEFALSEFALSE
34FALSEFALSEFALSETRUE
49TRUEFALSETRUEFALSE
54FALSETRUEFALSETRUE
61TRUEFALSEFALSEFALSE
720TRUEFALSEFALSEFALSE
814FALSETRUEFALSETRUE

The googling I have done suggests that I unpivot the team rows. But if I do that, I end up with each individual being listed more than once on the table and so my card is incorrect when no selection is made on the slicer.

 

So, what I'm looking for is either a way to do this filter with the data in "wide" format OR a way for my card to only consider one row per individual with the data in "long" format.

  • Anonymous , Try a measure like

    AverageX(Summarize(Table, Table[PERSONID], [NCLIENT]), [NCLIENT])

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      I've done that, but the trouble is Person 1 belongs to two teams. So, if I am generating an "overall" average number of clients (i.e., without selecting a team on the slicer) that person gets counted twice in the computation of the average.

  • Anonymous , Try a measure like

    AverageX(Summarize(Table, Table[PERSONID], [NCLIENT]), [NCLIENT])