Forum Discussion

JituPBI's avatar
JituPBI
Frequent Visitor
3 years ago
Solved

Conditional formating using what if parameter

Hello Community Members

I have a question related to what dynamic conditional formating using What if parameter

When I am trying to conditionally format a bar graph data color using a measure with hard coded values the conditional formating works fine but when I try to replace the hard coded numbers with selected values in what if parameter slicer my conditional formating is not working as expected and behaving wierldly. Can anyone help in this regard

 

Test_color =

IF (

    [% Approved BIAs] >= 0.9,

    "#45ac34",

    IF (

        [% Approved BIAs] >= 0.8,

        "#ee7203",

        IF ( [% Approved BIAs] <= 0.7, "#e51f22" )

    )

)

This measure works fine

 

but the moment is replace the 0.9, 0.8 and 0.7 with the values below

 

Test_color =
IF (
    [% Approved BIAs] >= [% Approved Bia's - Green Config Table Value],
    "#45ac34",
    IF (
        [% Approved BIAs] >= [% Approved Bia's - Amber Config Table Value],
        "#ee7203",
        IF ( [% Approved BIAs] <=[% Approved Bia's - Red Config Table Value], "#e51f22" )
    )
 
In the above logic I am giving the user configure the thresholds using the slicers like below the results are not showing the same way it should be. Any help would be appreciated.
 

5 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    JituPBI 
    Make sure the DAX for your [% Approved Bia's - Amber Config Table Value] is correct. If you're using the default - ensure you have a default value supplied. Also check that your value is a number and not percent - you may need to multiply or divide by 100 to get it to behave as expected.

     

    Finally (or maybe initially) - are you trying to conditionally format the same slicer as the what if parameter? This doesn't work unfortunately since the context of the slicer itself still has all the values for that parameter. You need to apply the conditional formatting on a different visual than the slicer. 

    • JituPBI's avatar
      JituPBI
      Frequent Visitor

      Hello AllisonKennedy, I am using the correct DAX for [% Approved Bia's - Amber Config Table Value] and it is also configured correctly as decimal number where as the value that I want to change as per the result on the slicer is on a bar graph and not trying to format the slicer. Maybe If possible I can connect with you and explain my scenario, If that helps