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
Zaky
Helper IV
Helper IV

Conditional Formatting

Hi ,

How can i make a conditional formatting that is more dynamic , based on ranges?
For example, I would like to have the bar chart to be Green color if the range is "3 - 7 days", Red if range "8 - 15 days" and so on.

Currently I have created the measure to count ticket ids for each ranges as follow.

 

Ageing(3-7days) = CALCULATE(COUNTROWS('Incident Ageing Report'),'Incident Ageing Report'[Ageing Range]="3 - 7 Days")

ageing range.JPG

 

If anyone can help me would be much appreciated.

 

Thanks

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

Hi @Zaky 

Clustered column chart don't have Conditional Formatting function like table or matrix visuals. But you can use Data colors in Format.

Due to I don't know your data model, I build a sample table to have a test.

1.png

Ageing Range is a calculated column.

Ageing Range = 
IF (
    'Incident Ageing Report'[Ageing] >= 3
        && 'Incident Ageing Report'[Ageing] <= 7,
    "3-7 Days",
    IF (
        'Incident Ageing Report'[Ageing] <= 14,
        "8-14 Days",
        IF (
            'Incident Ageing Report'[Ageing] <= 30,
            "15-30 Days",
            IF (
                'Incident Ageing Report'[Ageing] <= 60,
                "31-60 Days",
                IF ( 'Incident Ageing Report'[Ageing] <= 80, "61-80 Days", ">81 Days" )
            )
        )
    )
)

 Then build a Clustered column chart.

2.png

You can change Data color by range in Format.

3.png

You can download the pbix file from this link: Conditional Formatting

 

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 @Zaky 

Clustered column chart don't have Conditional Formatting function like table or matrix visuals. But you can use Data colors in Format.

Due to I don't know your data model, I build a sample table to have a test.

1.png

Ageing Range is a calculated column.

Ageing Range = 
IF (
    'Incident Ageing Report'[Ageing] >= 3
        && 'Incident Ageing Report'[Ageing] <= 7,
    "3-7 Days",
    IF (
        'Incident Ageing Report'[Ageing] <= 14,
        "8-14 Days",
        IF (
            'Incident Ageing Report'[Ageing] <= 30,
            "15-30 Days",
            IF (
                'Incident Ageing Report'[Ageing] <= 60,
                "31-60 Days",
                IF ( 'Incident Ageing Report'[Ageing] <= 80, "61-80 Days", ">81 Days" )
            )
        )
    )
)

 Then build a Clustered column chart.

2.png

You can change Data color by range in Format.

3.png

You can download the pbix file from this link: Conditional Formatting

 

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. 

amitchandak
Super User
Super User

@Zaky , you can do conditional formatting based on the measure . But I doubt you can do that on Clustered bar visual with a legend or multiple columns.

 

example

color = if([age]= "30-50" ,"red", "white")

steps - we use it this measure after choosing "Field value" in conditional formatting

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

 

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.