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
Anonymous
Not applicable

Clustered Column Chart - Data Colours Keep Changing on Data Refresh

Hi,

 

I have a Clustered Column Chart that is filtered to only show the last 3 months worth of data. Each month this report is updated automatically and a new months data is added (the previous month). When the report refreshes; a new month is added to the visual and the data colours keep changing and reflect the theme. I don't want this.

 

I want the first date (the earliest) to be red, the middle date to be grey and the last date (latest) to be black. I want this no matter which 3 months are selected. Is there any way to acheive this?

 

What it should look like:

goochy13_0-1628663424438.pnggoochy13_1-1628663234268.pnggoochy13_3-1628663307046.png

 

 

What happens on refresh:

goochy13_2-1628663269699.png

 

 

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

Create a measure as below:

Measure =
VAR _lastmonth =
    CALCULATE ( MONTH ( MAX ( 'Table'[Date] ) ), ALL ( 'Table' ) )
VAR _middilemonth =
    IF ( _lastmonth = 1, 12, _lastmonth - 1 )
VAR _firstmonth =
    IF ( _lastmonth = 2, 12, IF ( _lastmonth = 1, 11, _lastmonth - 2 ) )
RETURN
    IF (
        MONTH ( MAX ( 'Table'[Date] ) ) = _lastmonth,
        1,
        IF (
            MONTH ( MAX ( 'Table'[Date] ) ) = _middilemonth,
            2,
            IF ( MONTH ( MAX ( 'Table'[Date] ) ) = _firstmonth, 3 )
        )
    )

Then go to field>data color>formatting:

vkellymsft_0-1628836737876.png

Create a formatting rule as below:

vkellymsft_1-1628836759114.png

 

And you will see:

vkellymsft_2-1628836774149.png

My sample data is a bit simple,you could adjust the measure to suit your senario.

Check my .pbix file attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

amitchandak
Super User
Super User

@Anonymous , as of now conditional formatting is not supported on multiple legends , i doubt you can control that

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.