Forum Discussion

Ashish_Mathur's avatar
Ashish_Mathur
Super User
11 months ago
Solved

Cohort analysis

Hi,

I am working on survey response data of students who attended a course in a University.  My objective is to "Count the students who rated the course/instructor a 5 on one parameter and say 3 on another parameter".  So i need a matrix visual with one parameter shown on the Row labels, another on the column labels and each paramter is ranked from 1-5.  So the matric will be a 5*5 matrix.  In the screenshot, i have dragged "Overall perception (NPS score)" [parameter 1] to the row labels and "Instructor effectiveness and Teaching quality" [parameter 2] to the columb labels.  R1:R5 are the rating with 5 being the best.  So on parameter 1, 20 students gave a rank of 5 and the same number gave a rank of 4.  I would now like to show R1:R5 in the column labels as well but am unable to do so.  Once that happens, i will be able to know how many students who ranked the course/instructor 4 on parameter 1, ranked the course/instructor 1,2,3,4,5 on parameter 2.  Please help me with revising my measure, relationships to make this work.

 

 

Thank you.

 

  • MFelix's avatar
    MFelix
    11 months ago

    Hi Ashish_Mathur ,

     

    I believe I was able to do the matrix you need:

     

    In the example you have you get 20 persons gettting ratings of 4 and 5 for overall perception base on the image you provided.

    I have done the check for Intructor Efecctives and I got this result:

     

    This means that I have values that may cross over in ters of Rating 2,3,4,5 of Instructor and Rating 4,5 of the Overall.

     

    If we create two disconnected tables with the ratings, this will allow to have use of the rating in the matrix and get additional context for calculation and add the following measure:

    Comparition of ratings = 
    VAR RatingComparative =
        FILTER (
            ADDCOLUMNS (
                Students,
                "RatingCalculation",
                    CALCULATE (
                        _Measures[Measure],
                        'Rating buckets'[Rating] = SELECTEDVALUE ( RankingComp[Rating] ),
                        'Objective questions grouping'[Categories]
                            = SELECTEDVALUE ( 'Objective questions grouping_dup'[Categories] )
                    )
            ),
            [RatingCalculation] <> BLANK ()
        )
    VAR RatingComparativeDub =
        FILTER (
            ADDCOLUMNS (
                Students,
                "RatingCalculation",
                    CALCULATE (
                        _Measures[Measure],
                        'Rating buckets'[Rating] = SELECTEDVALUE ( rankingcomp2[Rating] ),
                        'Objective questions grouping'[Categories]
                            = SELECTEDVALUE ( 'Objective questions grouping'[Categories] )
                    )
            ),
            [RatingCalculation] <> BLANK ()
        )
    RETURN
        COUNTROWS ( NATURALINNERJOIN ( RatingComparative, RatingComparativeDub) ) + 0

     

    This will return the following values:

     

    Has you can see the total number of persons is 40.

     

    I haven't double check the results, but looking at the measure you have calculated this matches.

     

    See PBIX file attach.

11 Replies

  • Hi Ashish_Mathur 

     

    I tried to implement your query by creating a simple dataset as show:

     

    Based on this I created your expected visual as below:

    Does this meet your expectations?

    Please let me know 

     

    Best regards,

     

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Thank you for replying.  Could you apply your technique on the file which i shared in the post and then share the download link of your solution file with me?

    • MFelix's avatar
      MFelix
      Super User

      Hi Ashish_Mathur ,

       

      What is the final result you are trying to get, is a value that has both ratings matching lets assume the following:

      Overall perception (NPS score) - Rating 5 - S1, S2, S3, S4, S5 - 5 students total

      Instructor effectiveness and Teaching quality - Rating 5 - S1, S2, S6 - 3 students total

      R5  vs R5 = 2 Students - S1, S2 ?

      Instructor effectiveness and Teaching quality - Rating 4 - S3, S4, S5, S7 - 4 students total

      R5 vs R4 = 3 Students - S3, S4, S5?

       

      Is this what you want can you please give some more context on what is the final result please.

       

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Yes MFelix.  That is exactly what i want in a 5*5 matrix visual.  In the row labels, i'd like to have "Overall perception (NPS score)" and in the column labels, I'd like to have "Instructor effectiveness and Teaching quality".  These 2 parameters should be swappable by other fields (which in turn will have ratings from 1-5).

        Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ashish_Mathur ,

    Just checking in, were you able to try unpivoting your survey data as suggested? Once you restructure it, the 5×5 matrix should come together pretty easily with the parameters on rows/columns and DISTINCTCOUNT(StudentID) as values. Let us know if you got it working or if you hit any snags along the way.

    Thanks,
    Akhil.