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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
srinivasinbox83
Regular Visitor

How Fix the color of Lines in a line chart when data changes ( chart show last N months data)

Hello !!

My requirement is my line chart always show last 4 months data, so we see 4 lines in my chart,

how we can fix the color code of these lines irrespective of month changes.

Say in July - > the report shows lines for Apr, May, June & July -> colors are Grey,Black, Green,Red

 

When month changes -> the report will have May, June, July and August -> here I still need the same colors Grey, black , Green & Red.

 

Appreciate any help on this .

5 REPLIES 5
lbendlin
Super User
Super User

Instead of showing the month names can you show "Current month","Current-1","Current-2","Current-3"? This would require setting up calculated columns accordingly.

 

That way the labels will be the same and the color won't change.

Thanks for your prompt response, the month names Apr, May , June are not calculated values, they are the values from Month column, when I use the month column in my legend the line for over all amount  splits in to multiple line for each month ( There is a month filter to show only last 4 months)

I know they are not but if you make them calculated columns (during data refresh) then it can work.

but will my tooltip on line chart shows the month name of each line ?

Day of month (1 to 31 days) on my axis 

Amount (This is cumulative amount of each day of a month) on Values 

Month on Legend

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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