Forum Discussion
duesouth
1 year agoHelper I
Add Arrows to a Matrix
I've got a matrix for % attendance in a school - which is cumulative attendance week-on-week, as below: ...
- 1 year ago
Hi duesouth
First create a measure to calculate the difference:
Attendance Change = VAR CurrentWeek = MAX('Date'[Date]) VAR CurrentAttendance = [Attendance Measure] VAR PreviousWeek = CALCULATE( MAX('Date'[Date]), FILTER( ALLSELECTED('Date'), 'Date'[Date] < CurrentWeek ) ) VAR PreviousAttendance = CALCULATE( [Attendance Measure], FILTER( ALLSELECTED('Date'), 'Date'[Date] = PreviousWeek ) ) RETURN IF( NOT(ISBLANK(PreviousAttendance)), CurrentAttendance - PreviousAttendance, BLANK() )
Then apply conditional formatting to your attendance values:
Select your matrix visual
Go to "Conditional formatting" → "Icons"
Set up rules like:
When value > 0.001 → Green up arrow
When value < -0.001 → Red down arrow
Base the formatting on the "Attendance Change" measure
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
speedramps
1 year agoSuper User
Hi duesouth
Try this ...
Create data
Create measure
Arrow =
VAR thisweek = SELECTEDVALUE('Table'[Week])
VAR thisattendance = SUM('Table'[Attendance%])
VAR previousattendance =
CALCULATE(
SUM('Table'[Attendance%]),
ALL('Table'[Week]),
'Table'[Week] = thisweek - 7
)
RETURN
SWITCH(TRUE(),
ISBLANK(previousattendance),FORMAT(thisattendance,"Percent"),
thisattendance = previousattendance,FORMAT(thisattendance,"Percent"),
thisattendance > previousattendance, CONCATENATE(FORMAT(thisattendance,"Percent"), "▲"),
CONCATENATE(FORMAT(thisattendance,"Percent"), "▼")
)
Draw matrix
Please click thumbs up and accept solution