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
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
v-rzhou-msft
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
v-rzhou-msft
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.. @v-rzhou-msft it worked for me, just by modifying your logic i am able to get the desired result.

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.