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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jalenm
New Member

Change callout value color based on parameter

My question is simple yet I can not find any good help with this problem. I have set a color based on a rule that makes it either green when the value is above 13,000 and red if it is below that. This all works fine but I need to get the number from a parameter instead of a hardcoded 13,000. Is this possible and if so how would I achieve that? 

 

Thanks in advance,

Jalen

 

Image describing problem:

ss_powerbi.png

1 ACCEPTED SOLUTION

@jalenm ,

You can create a measure, There you can use a whatif parameter measure or a meausre

 

Example

Meausre = Switch( True() ,

[Bedrag Running Total Bedrag] < [What if] , "Red",

[Bedrag Running Total Bedrag] < [What if 2] , "Green" )

 

 

Use this in conditional formatting using field value option

 

You can also use min and max value of what if

 

new measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = minx(allselected(whatif),whatif[value])
return

Switch( True() ,

[Bedrag Running Total Bedrag] <_min , "Red",

[Bedrag Running Total Bedrag] < _max , "Green" )

 

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

View solution in original post

4 REPLIES 4
AminAlian
Frequent Visitor

Hello @jalenm !

 

The thought here is that if you hard code a value, it can never change, thus never change color.

Therefore you are supposed to enter the field where you get this number that is supposed to change color from.

 

For example if you want it to change if the SUM of a value is over/under 13000, enter the measure which contains the sum of the value in to the field.

My bad for not being clear enough. I don't want to change the number that the field is based on (That bedrag running total is correct and it already works properly) But I want the user to be able to choose an amount with a slicer parameter. Then the value they have selected should replace the 13,000 number from the image. The 13,000 number I put there is just a placeholder but it should be a dynamic number from the parameter.

@jalenm ,

You can create a measure, There you can use a whatif parameter measure or a meausre

 

Example

Meausre = Switch( True() ,

[Bedrag Running Total Bedrag] < [What if] , "Red",

[Bedrag Running Total Bedrag] < [What if 2] , "Green" )

 

 

Use this in conditional formatting using field value option

 

You can also use min and max value of what if

 

new measure =
var _max = maxx(allselected(whatif),whatif[value])
var _min = minx(allselected(whatif),whatif[value])
return

Switch( True() ,

[Bedrag Running Total Bedrag] <_min , "Red",

[Bedrag Running Total Bedrag] < _max , "Green" )

 

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

Thank you so much! Honestly I probably would have never thought of that solution.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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