Forum Discussion

bwhiteaccess's avatar
bwhiteaccess
New Member
2 years ago
Solved

Count the relationships

I need to figure out the number of patients I have with different benefit plans and which or primary, secondary or tertiary.  I have the following columns Benefit Plan Name, Patient and Benefit Plan...
  • ryan_mayu's avatar
    ryan_mayu
    2 years ago

    bwhiteaccess 

    maybe you can try this in PQ.

     

    1. sort the benefit plan name column

     

    2. create a new column to combine benefit name and priority column

     

    =[Benefit Name] & " "&[Benefit Plan Priority]

     

     

    3. group by

     

    = Table.Group(#"Added Custom", {"patient name"}, {{"Benefit", each Text.Combine([Custom],","), type text}})

     

     

    at last, you can use distinctcount or remove duplicates to  get the benefit combination amount.

     

    pls see the attachment below