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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Barculez
Regular Visitor

Fixed colour of columns

Hello, 

 

a would like to ask for help with colour of columns. I have weekly report, where are graphs of last 4 weeks, there are always same colours. Actual week is yellow, second one is grey, third is orange and last one is blue → the weeks are changing every week, but I need the colours always be the same based of week age.

 

Thank you for your help

Barbora 

3 REPLIES 3
MFelix
Super User
Super User

Hi @Barculez ,

 

For this you need to make a measure to force the colour of your weeks something similar to this:

Colour Coding =
SWITCH (
    TRUE (),
    MAX ( 'Date'[Week] ) = WEEKNUM ( TODAY () ), "Yellow",
    MAX ( 'Date'[Week] )
        = WEEKNUM ( TODAY () ) - 1, "Grey",
    MAX ( 'Date'[Week] )
        = WEEKNUM ( TODAY () ) - 2, "Orange",
    MAX ( 'Date'[Week] )
        = WEEKNUM ( TODAY () ) - 3, "Blue"
)

Not sure if you want to have the current date for the current week or the last week selected on a calendar but should work when you added it to condittionl formattting.

MFelix_0-1690359789555.png

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



I don´t have there a date, I've there just numbers of week which I filter. 

 

The chart looks like this:

Barculez_0-1690360548281.png

 

and every week, when I filter those last weeks i have to change the colour here:

Barculez_1-1690360641151.png

 

Do you think that the measure will work for this too? Or there is another way.

 

Thank you very much 

 

 

Hi @Barculez ,

 

The Date is the name of the table were my week is so in your case you must replace the Date[Week] by the name of the table you have for example FactTable[Week] but be aware that since you are using the week as legend you cannot use the condittional formatting.

 

Do you always want to get the last 4 weeks for this chart? how is this being built?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors