Forum Discussion

Elisa112's avatar
Elisa112
Icon for Helper V rankHelper V
1 year ago
Solved

Comparing Matrix Values using Icons

Hi All Im trying to compare values a matrix for student scores across assessment stages, I have created a summarised table and ranked scores which provides this:   Assessment Table:   I th...
  • v-aatheeque's avatar
    v-aatheeque
    1 year ago

    Hi Elisa112 ,
    Thanks for reaching out to Microsoft Fabric Community Forum.
    Based on the above scenario ,

    First fetch Previous Score using below DAX query :

    PreviousScore = 
    VAR CurrentStudent = Sheet1[StudentID]
    VAR CurrentStage = 'Sheet1'[AssessmentStage]
    RETURN
        CALCULATE(
            MAX('Sheet1'[Score]),
            FILTER(
                'Sheet1',
                'Sheet1'[StudentID] = CurrentStudent &&
                'Sheet1'[AssessmentStage]= CurrentStage - 1
            )
        )
    

     

    create a new calucalted cloumn for change direction as below :

    ScoreTrend = 
    VAR Curr = 'Sheet1'[Score]
    VAR Prev = 'Sheet1'[PreviousScore]
    RETURN
        IF(ISBLANK(Prev), BLANK(),
            SWITCH(TRUE(),
                Curr > Prev, "UP",
                Curr < Prev, "DOWN",
                Curr = Prev, "SAME"
            )
        )
    

     create a matrix visual and apply conditional formatting  the icon set to display up, down, or same arrows based on the ScoreChange.

    Below is the expected output :

     

    If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.

    If you continue to face issues, feel free to reach out to us for further assistance!