Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Daniel_B
Helper II
Helper II

SWITCH for 2 parameters (possibly 3 with a blank statement)

Hi There

 

I've created a measure which shows an up arrow if the current month is greater than the previous month however I would like to add a down arrow if it is lower than the previous month and if there is no data or the values are the same just a line (I have the Unichar codes available to hand)

 

Here is my code so far 

 

 

Difference = 
SWITCH(TRUE(),[%Extreme]<'Sample Data'[%Extreme LM],
UNICHAR(9660), BLANK())

 

 

Any help would be greatly appreciated

 

Thanks


Dan 

1 ACCEPTED SOLUTION

Hi @Daniel_B ,

 

if you replace the unichar codes by the colours you want then use that measure as your condittional formatting should work on the color of the arrows as needed.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
Daniel_B
Helper II
Helper II

Okay so I've solved this challenge now but I would like to know if I've used the below measure for a scorecard to get the trend arrow, is there a way of making it change color depending on the UNICHAR code I'm using for the arrow based on the results (see code below) - as I'm using a scorecard I know I can't use conditional formatting on the value 

 

%Difference Arrow = IF([%Extreme]>[%Extreme LM],UNICHAR(9650),IF([%Extreme]<[%Extreme LM],UNICHAR(9660),UNICHAR(9644)))

 

Arrow up = RED

Arrow down = GREEN

Line = Yellow

Hi @Daniel_B ,

 

if you replace the unichar codes by the colours you want then use that measure as your condittional formatting should work on the color of the arrows as needed.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @Daniel_B ,

 

You need to use a similar measure to this one:

 

Difference =
SWITCH (
    TRUE (),
    [%Extreme] < 'Sample Data'[%Extreme LM]
        || [Measure] = BLANK (), UNICHAR ( 9660 ),
    [%Extreme] = 'Sample Data'[%Extreme LM], UNICHAR ( 9999 ),
    BLANK ()
)

Replace the codes for unichar and the measure for the ones that adjust to your model. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.