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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors