Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I've got a matrix for % attendance in a school - which is cumulative attendance week-on-week, as below:
Week Ending | ||||
Name | 23/05/2025 | 30/05/2025 | 06/06/2025 | 13/06/2025 |
Pupil 1 | 95.5% | 95.5% | 95.8% | 95.9% |
Pupil 2 | 98.1% | 97.5% | 97.6% | 97.6% |
I'd like Power BI to compare a week to the previous week and add up/down/same arrows to make it easy to see (so for pupil 1, comparing 13 June to 6 June attendance is up, so I'd like an up arrow to be displayed next to the 13/06/2025 column).
Is this possible? As always, any and all help greatly appreciated.
Solved! Go to Solution.
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.
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
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.
Worked perfectly - thank you so much!
If the default arrow icons don't meet your needs, there are several alternative ways to implement custom trend indicators in Power BI:
DAX Character Arrows
You can directly include arrow symbols (▲▼↗↘→) in your DAX measures by concatenating them with your values. This approach uses Unicode characters and works across all Power BI visuals.
JSON Formatting
Power BI allows custom icon sets through JSON formatting rules. You can:
Create a JSON file defining your preferred icons
Specify exact colors and positioning
Apply different icon styles for various value ranges
This method provides consistent styling across your report.
SVG Icons
For complete design control:
Embed SVG code directly in your measures
Customize every aspect (shape, color, size)
Use any vector graphic as an indicator
Note: SVG rendering only works in web browsers, not the desktop app.
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.
User | Count |
---|---|
84 | |
77 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |