Forum Discussion

Sean2's avatar
Sean2
Helper I
6 years ago
Solved

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 responderSecond ResponderThird Responder
Incident 1BobAllennull
Incident 2Allennullnull
Incident 3JoeBobBeth
Incident 4BethSallyBob
  • 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