cancel
Showing results for 
Search instead for 
Did you mean: 
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



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

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



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

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

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 25

Ted's Dev Camp - August 25, 2022

Watch Session 25 of Ted's Dev Camp.

Top Solution Authors