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
16kernse
Frequent Visitor

Changing the Color of Data Bars in a Matrix

I'm trying to change the data bar colors in my Matrix, based on what column they fall in. Less than 15 = Green, Between 15 & 25 = yellow, and More than 25 = red. This is independent of invoice count or invouce amounts. In the below screenshot, you will notice I have been able to do what I want with icons, but I want to change the color of the databars, instead. Icons allow us to base the rules on another field, where data bars only let us change to colors based on the individual record. Is there a work around, or is this just how data bars work? I find it odd this functionality would exist for icons, but not data bars.

 

I want to apply icon rules to data bars and remove icons altogether

16kernse_1-1656440711739.png

 

icons rules, works

16kernse_2-1656440866411.png

data bars rule, doesn't work

16kernse_3-1656441048006.png

 

 

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @16kernse ,

I created some data:

vyangliumsft_0-1656639052839.png

Here are the steps you can follow:

1. Create measure.

color1 =
SWITCH(
    TRUE(),
    [invoice_count] >=1&&[invoice_count]<=3,"green",
    [invoice_count] >3&&[invoice_count]<=6,"yellow",
    [invoice_count] >6&&[invoice_count]<=10,"red")
color2 =
SWITCH(
    TRUE(),
    [invoice_amount] >=1&&[invoice_amount]<=3,"green",
    [invoice_amount]>3&&[invoice_amount]<=6,"yellow",
    [invoice_amount]>6&&[invoice_amount]<=10,"red")

2. In Format - Conditional - set [invoice_amount] and [invoice_count] respectively.

vyangliumsft_1-1656639052840.png

3. Go to Background color – invoice_amount.

Format style – Field value

What field should we base this on – [color1]

vyangliumsft_2-1656639052841.png

4. Go to Background color –invoice_count.

Format style – Field value

What field should we base this on – [color2]

vyangliumsft_3-1656639052842.png

5. Result:

vyangliumsft_4-1656639052842.png

 

Best Regards,

Liu Yang

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

Hi Liu. Thanks fo your response, but I'm trying to do this in data-bars and not the background color. Also, I am wanting the whole columns to be one color. Less than 15 = green, between 15 & 25 = yellow, more than 25 = red, regardless of invoice amount and invoice count. I'm trying to use the icon logic in the colors of the data bars, but i'm not convinced this is possible.

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.