cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MiteshY
Frequent Visitor

Custom Conditional Formatting based on user selection.

Hello Everyone, 

 

I am working on a dashboard which requires to change conditional formatting based on user input. 

 

For eg.

 

There is a target and conditional formatting is done on it based on 

 

Minimum value to 90% down arrow

90% to 100% horizontal arrow

Above 100% up arrow.

 

Now the user wants that the conditional formatting of target should change based on his selection for eg.

 

If the user wants to change target % from 

Minimum to 80% then arrow should change like

 

Minimum to 80% down arrow,

80% to 100% horizontal arrow

Above 100% up arrow.

 

Please help..

1 ACCEPTED SOLUTION
RicoZhou
Community Support
Community Support

Hi @MiteshY ,

 

Firstly, I suggest you to create a percentage slicer by What if Parameter. Then use between option for that slicer. Here I suggest you to use whole number in what if parameter as below. If you use increment 0.01 and range from 1 to 1.2, Power BI will return incorrect result.

RicoZhou_2-1675671365924.png

 

RicoZhou_1-1675671332665.png

Measure:

Measure = 
VAR _RangeStart = MIN(Parameter[Parameter])/100
VAR _RangeEnd = MAX(Parameter[Parameter])/100
VAR _Percentage =CALCULATE(SUM('Table'[Value]))
RETURN
IF(_Percentage <=_RangeStart,-1,IF(_Percentage>_RangeEnd,1,0))

Finally, you can use conditional formatting in cell elements and set as below.

RicoZhou_3-1675671480801.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
RicoZhou
Community Support
Community Support

Hi @MiteshY ,

 

Firstly, I suggest you to create a percentage slicer by What if Parameter. Then use between option for that slicer. Here I suggest you to use whole number in what if parameter as below. If you use increment 0.01 and range from 1 to 1.2, Power BI will return incorrect result.

RicoZhou_2-1675671365924.png

 

RicoZhou_1-1675671332665.png

Measure:

Measure = 
VAR _RangeStart = MIN(Parameter[Parameter])/100
VAR _RangeEnd = MAX(Parameter[Parameter])/100
VAR _Percentage =CALCULATE(SUM('Table'[Value]))
RETURN
IF(_Percentage <=_RangeStart,-1,IF(_Percentage>_RangeEnd,1,0))

Finally, you can use conditional formatting in cell elements and set as below.

RicoZhou_3-1675671480801.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank You so much.. @RicoZhou it worked for me, just by modifying your logic i am able to get the desired result.

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!