Arrow Rating

Regular Visitor
2818 Views
Highlighted
Regular Visitor
Posts: 17
Registered: ‎05-04-2017

Arrow Rating

[ Edited ]

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: 

Arrow Rating =
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
        FALSEIF (
            __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 --
        TRUEIF (
            __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

 

 

Regular Visitor
Posts: 22
Registered: ‎07-13-2018

Re: Arrow Rating

This is great! Thanks for contributing, is it possible to change the colors of the arrows?

Member
Posts: 56
Registered: ‎11-04-2016

Re: Arrow Rating

Yes. You can change the colour of the arrow on the format section.