Forum Discussion
Counting a value from multiple columns
We have an excel spreadsheet like the example below. I'm trying to figure out how I can count the responders by incidents. For example, how many total incidents did Bob respond to? (3 is the answer I'm looking for) I can easily count how many times he was the Primary responder.
Any advice would be appreciated thanks.
| Incident # | Primary responder | Second Responder | Third Responder |
| Incident 1 | Bob | Allen | null |
| Incident 2 | Allen | null | null |
| Incident 3 | Joe | Bob | Beth |
| Incident 4 | Beth | Sally | Bob |
Hi Sean2 ,
You can "unpivot" columns in "edit queries".
Use "responder" as the filter, and create the following two measures.
count_respond_times = CALCULATE(COUNTROWS(Sheet1))count_ Primary_responder_times = CALCULATE(COUNTROWS(Sheet1),FILTER(Sheet1,Sheet1[Attribute]="Primary responder"))You can also refer to the pbix.Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Greg_DecklerCommunity Champion
Ah, you want my multi-column aggregations quick measure:
- AnonymousNot applicable
With this formula:
Bob = IF(OR('Table'[Primary responder] = "Bob", OR('Table'[Second Responder] = "Bob", 'Table'[Third Responder] = "Bob")), 1, 0)I created 4 new columns for each responder. Then each column is represented by the cards. - V-lianl-msftCommunity Support
Hi Sean2 ,
You can "unpivot" columns in "edit queries".
Use "responder" as the filter, and create the following two measures.
count_respond_times = CALCULATE(COUNTROWS(Sheet1))count_ Primary_responder_times = CALCULATE(COUNTROWS(Sheet1),FILTER(Sheet1,Sheet1[Attribute]="Primary responder"))You can also refer to the pbix.Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.