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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Conditional Formatting for a measure values

Hello All,


I really need urgent help in conditional formatting (Background)

I have a matrix visual which shows 2 categories and based on that I have calculated change 
sales price,count,avg and Change all are measures

PDRC_123_0-1679380368884.png

on Change I have to apply the background color based on below condition
If values in the change <  -50%  then dark red
-50% to 0% should be red
0% to 50% green
> 50% dark green

what I have done

I was not able to apply on negative % to I started with positive

if value >0(percent)  and <= then 50(percent) dark green
if value >50(percent)  and <= then 100 (percent) green  

still with the above logic, it is not formatting the values
Please let me know how can I add those buckets





1 ACCEPTED SOLUTION
SamInogic
Super User
Super User

Hi @Anonymous , 

 

As per our Understandings you are looking for Background color change on Measure witch if else Condition 

 

This is My Sample table:
Sample Table.png

You can achieve this by Creating a column Using Below DAX Expression and using it in Conditional Formatting.

 

ColorColumn =

 

var percentageValue = [% Percentage]

 

var DarkRed =

"#8b0000"

 

var red =

"#FF0000"

 

var green =

"#00ff00"

 

var darkGreen =

"#006600"

 

return

IF(percentageValue> 0 && percentageValue <

1, DarkRed,IF(percentageValue>1 && percentageValue<5, red,IF(percentageValue>5

 && percentageValue <45 , green,IF(percentageValue>45,darkGreen))))

color.png

Now Just use this color Column in conditional Formatting

formatting.png

Choose the Colour Column :

background color.png

 

This will give below result:

output.png
If possible you can provide us a sample pbix report with your data structure, so we can check and help you to achieve this in your report as well.

 

If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello @SamInogic 

Thank you so much for the help I really appreciate that you helped me this fast.

Just want to confirm that power does not support conditional formatting for negative percentages right?

PDRC_123_0-1679385629630.png

because it is giving me an error saying logical error. I know you have told me the workaround way. But just want to clarify.


And once again Thank you so much for all the help.

Hi @Anonymous 

Yes, we cannot use negative values when there's a percent is selected to the Rule, However you can try this with Number,
percent error.png

Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

 

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/
SamInogic
Super User
Super User

Hi @Anonymous , 

 

As per our Understandings you are looking for Background color change on Measure witch if else Condition 

 

This is My Sample table:
Sample Table.png

You can achieve this by Creating a column Using Below DAX Expression and using it in Conditional Formatting.

 

ColorColumn =

 

var percentageValue = [% Percentage]

 

var DarkRed =

"#8b0000"

 

var red =

"#FF0000"

 

var green =

"#00ff00"

 

var darkGreen =

"#006600"

 

return

IF(percentageValue> 0 && percentageValue <

1, DarkRed,IF(percentageValue>1 && percentageValue<5, red,IF(percentageValue>5

 && percentageValue <45 , green,IF(percentageValue>45,darkGreen))))

color.png

Now Just use this color Column in conditional Formatting

formatting.png

Choose the Colour Column :

background color.png

 

This will give below result:

output.png
If possible you can provide us a sample pbix report with your data structure, so we can check and help you to achieve this in your report as well.

 

If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.


Thanks!

Inogic Professional Service Division

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop an email at crm@inogic.com

Service:  http://www.inogic.com/services/ 

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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