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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jj6291
Frequent Visitor

Dynamically format line color of two date snapshots of forecasts (Sample file attached)

Problem

I have a data set that has snapshots of forecasts. As you can see in the screenshot below, we have forecasts of the same dates, 1 Feb, 1 March, 1 Apr, 1 May at different points in January.

jj6291_0-1676869544351.png

 

I want to make a plot that compares two snapshots, one in the past and a later one. This is easy to do by creating a new column that links the category and snapshot date (see above). This makes the plot I am after, but the colors are all different and make it hard to read.

jj6291_1-1676869694286.png

 

Manually changing the colors won't work since the dates will always be changing, so the solution needs to be dynamic.

 

What I want:

I want to dynamically give the older date one color and the newest date another color so comparisons are easy, for example I did this below.

jj6291_2-1676869861038.png

 

 

I tried creating a measure that gets the min and max date of the slicer selection and use that to make a new column that says Category - Old or Category - New depending on it's asatdate, but that didn't work for me. Open to other ideas, im sure there is a simple fix that I am missing.

 

Thank you!

 

 

Here is a link to a sample file i made:

https://drive.google.com/file/d/1cUyt8vnuyfNKWDCOdynAqSnFPiS57GZH/view?usp=sharing

2 REPLIES 2
amitchandak
Super User
Super User

@jj6291 , Conditional formatting is not supported in line visual. Also, the marker color workaround does not work when using legend

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Yes, but if I create a column that classifies the before and after date, then I can use that in the legend field right?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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