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
breuwer
Frequent Visitor

Diverging colors background based on measure

Hi all, 

 

First time questioner, but I have already used this community for so many questions so thanks for that! 🙂

 

My question, I would like to write a DAX measure that has diverging colors (like in the settings below) as an output in order to use "format by field value" instead of "format by color scale". 

 

breuwer_0-1629291541909.png

I would like this since I have to implement these backgrounds for many visuals in my report. 

 

Requirements: 

Lowest value is color #EE4B2B
Midpoint is a fixed number: 100 and is color #FFFFFF

Highest value is color #00A36C
The measurement difining the value is a simple sales index, let's call it [Sales Index].

Any pointers are much apreciated!

Kind regards, 

Bas

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @breuwer 

What you need is hard to achieve in powerbi. If you want to format by field value, then you inevitably have to mark a color for each unique value.、

 

I'm afraid that currently you can only manually set the background conditional formatting one by one.

 

Best Regards,
Community Support Team _ Eason

 

 

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi,  @breuwer 

What you need is hard to achieve in powerbi. If you want to format by field value, then you inevitably have to mark a color for each unique value.、

 

I'm afraid that currently you can only manually set the background conditional formatting one by one.

 

Best Regards,
Community Support Team _ Eason

 

 

amitchandak
Super User
Super User

@breuwer , filed value can have absolute colors.

Unless you have some logic to create diverging colors

 

mean based on number you can calculate some number

 

 

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.