Forum Discussion
Comparing Matrix Values using Icons
- 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!
thank you so much for this, I have tried to use your solution in the matrix, but I am still getting the same result :
Am I doing something wrong here?
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!