Search code examples
powerbidaxdata-analysispowerbi-desktopmeasure

Distribute COUNT for Types seperated by /


I have the following table :

OP Type                         OP ID
Client vs Client                125
Client vs N                     5636
B vs N Client                   54
Client vs Client/B vs N Client  51
Client vs Client                4
Client vs Client/B vs N Client  5
Client vs N                     31
B vs N Client/ Client vs N      45

I want to calculate the number of OP ID by OP Type using this condition : When for example we have : a type seperated by / like Client vs Client/B vs N Client

the count will be like below 1 goes to Client vs Client and 1 goes to B vs N Client 1 and 1 remains for Client vs Client/B vs N Client The output will be :

OP                                Count
Client vs Client                  4
Client vs N                       3
B vs N Client                     4
Client vs Client/B vs N Client    2
B vs N Client/ Client vs N        1

Solution

  • Try a Measure similar to:

    Special Count = 
      COUNTROWS(
        FILTER(
          ALLSELECTED('YourTable'),
          CONTAINSSTRING('YourTable'[OP Type], SELECTEDVALUE('YourTable'[OP Type]))
        )
      )