Arrow Rating
08-15-2017 03:11 AM - last edited 08-15-2017 03:29 AM
Arrow Rating
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-15-2017 03:11 AM - edited 08-15-2017 03:29 AM
NAME:
Arrow Rating
DESCRIPTION:
This quick measure shows an up arrow or down arrow when comparing a target value against a target value, or else "--" if not. Can also be inverted if a lower value is better compared to the target.
PARAMETERS:
Name: Base Value
Tooltip: Your base value / measure.
Type: Numerical field / measure
Name: Target
Tooltip: The value / field you wish to compare base value against.
Type: Numerical field / measure
Name: Inverted
Tooltip: Toggle whether lower value is better compared to the target.
Type: True / False
DAX:
VAR __BASE_VALUE = [Current Month] -- Set Variable for Value
VAR __TARGET = [Previous Month] -- Set Variable for Target
VAR __INVERT = FALSE -- Toggle Whether You Want To Invert The Result (i.e. Lower or Higher = Better)
RETURN
SWITCH (
__INVERT,
-- SWITCH Value to Check
FALSE, IF (
__BASE_VALUE > __TARGET,
UNICHAR ( 9650 ),
IF ( __BASE_VALUE < __TARGET, UNICHAR ( 9660 ), "--" )
),
-- If INVERT Variable is TRUE, Compare BASE_VALUE Variable Against TARGET Variable, Higher = Up Arrow, Lower = Down Arrow, Else --
TRUE, IF (
__BASE_VALUE > __TARGET,
UNICHAR ( 9660 ),
IF ( __BASE_VALUE < __TARGET, UNICHAR ( 9650 ), "--" )
)
)
NOTES:
A simple measure created with the UNICHAR function which was introduced to me by Chris Webb's quick measure and blog, so a big thanks to him. The measure uses some simple IF logic, making use of the switch function also. Using Chris's quick measure has encouraged my use of variables within DAX so I hope this can create some value to some people.
This quick measure would also benefit from conditional formatting (red or green for good or bad) however currently this is only applicable to numerical fields currently.
Thanks all!
Gordon
eyJrIjoiYTMwZjQ5Y2QtOTU4MC00ZWViLWFmZWItYWE2MjkyMWMxNjcxIiwidCI6ImRkYzVlNDUwLTM5NzUtNDEzOC05N2M4LTQxN2U4MmVmYWIyNSIsImMiOjh9
Re: Arrow Rating
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-04-2018 10:30 AM
This is great! Thanks for contributing, is it possible to change the colors of the arrows?
Re: Arrow Rating
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-07-2018 06:34 AM
Yes. You can change the colour of the arrow on the format section.