Forum Discussion

rchappelle's avatar
rchappelle
Frequent Visitor
4 years ago
Solved

Cohort/Group comparisons

 

I have a table like this

CustomerGenderPriorityLocationProductAgeNationality
1M11LeedsA33UK
2M17ManchesterB55UK
3F44LeedsC61French
4F32LeedsB19UK
5M7LeedsC52UK
6F18ManchesterB48UK
7F42LeedsA27UK
8M38ManchesterA23French

 

and I want to create the following matrix 

CohortProduct AProduct BProduct C
Male24.5177
Female423231
Age 35+ 

17.5

25.5
UK26.5

22.3

7
Leeds26.522.325.5

where the Values are the average of Priority

Male : Gender = M

Female : Gender = F

Age 35+ : Age >= 35

UK : Nationality = UK

Leeds : Location = Leeds

 

The best I have managed to create so far is 4 different matrixes but there are multiple different values we want to analyse so I'm having to create 4 different matrixes for each different analysis. Additionally, the column header is repeated at the top of each matrix which takes up a lot of room on the page. There must be a better way of doing this, can anyone tell me how I do this or what this type of grouping of cohorts is called so I know what I need to search for?

  • 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.

     

8 Replies

  • 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.

     

  • rchappelle's avatar
    rchappelle
    Frequent Visitor

    I've been using Power BI for a few months and have got stuck on a particular request. My issue is I can't find the correct search term to look up a solution. I am trying to compare multiple groups of people based on different criteria.

    I have a table like this

    CustomerGenderPriorityLocationProductAgeNationality
    1M11LeedsA33UK
    2M17ManchesterB55UK
    3F44LeedsC61French
    4F32LeedsB19UK
    5M7LeedsC52UK
    6F18ManchesterB48UK
    7F42LeedsA27UK
    8M38ManchesterA23French

     

    and I want to create the following matrix 

    CohortProduct AProduct BProduct C
    Male24.5177
    Female423231
    Age 35+11

    17.5

    25.5
    UK26.5

    22.3

    7
    Leeds26.522.325.5

    where the Values are the average of Priority

    Male : Gender = M

    Female : Gender = F

    Age 35+ : Age >= 35

    UK : Nationality = UK

    Leeds : Location = Leeds

     

    The best I have managed to create so far is 4 different matrixes but there are multiple different values we want to analyse so I'm having to create 4 different matrixes for each different analysis. Additionally, the column header is repeated at the top of each matrix which takes up a lot of room on the page. There must be a better way of doing this, can anyone tell me how I do this or what this type of grouping of cohorts is called so I know what I need to search for?

  • Moshood_AK's avatar
    Moshood_AK
    Regular Visitor

    Hi guys, i want to create a dashboard to compare two or three salespersons. Is there any idea on how i can go about it