Forum Discussion

rchappelle's avatar
rchappelle
Frequent Visitor
4 years ago
Solved

Cohort/Group comparisons

  I've been using Power BI for a few months and have got stuck on a particular request. I am trying to compare multiple groups of people based on different criteria. I have a table like this ...
  • MFelix's avatar
    4 years ago

    Hi rchappelle ,

     

    This can be achieved using measures for example:

    MAle = CALCULATE(AVERAGE( 'Table'[Priority]),'Table'[Gender] = "M")
    
    Female = CALCULATE(AVERAGE( 'Table'[Priority]),'Table'[Gender] = "F")
    
    Age 35 + = CALCULATE(AVERAGE( 'Table'[Priority]),'Table'[Age] >= 35)
    
    Location_ = CALCULATE(AVERAGE( 'Table'[Priority]),'Table'[Location] = "Leeds")
    
    Nationality Average = CALCULATE(AVERAGE( 'Table'[Priority]),'Table'[Nationality] in VALUES(Nationality[Nationality]))

     

    Then you can place it on a matrix and go to the options and turn on the option Show on Rows result below:

    To make it dinamic you can create tables for slicers in this case I have done it for nationality and you can see based on the selection of the slicer the average gets calculated. You just need to do one for each of your variations.

     

    PBIX file attach.

     

    This is just one option depending on your model and needs you can do MGI, calculation groups and all sort of things.