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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
zerosugar
Helper II
Helper II

Line Chart Conditional Color/Shape Based on Time and Legend Breakdown?

Hi all, I'd like to do something that seems simple on the surface but is giving me a lot of grief.

 

I'm working with a set of data that contains revenue forecasts. These forecasts are quarterly and each forecast contains 8 quarters: 1 quarter of actual revenue (the "jump-off"), and 7 quarters of predicted revenue. This way I can also add a line that is solely for actuals data, and then have a bunch of lines for all of the forecasts and then I can see how the forecasts branch off of the actuals. These forecasts are created each quarter and have two "scenarios": a positive scenario and a negative scenario.

 

That's mostly fine, but I'm having trouble with the line colors/shapes in this chart. What I want is for each quarter, the Positive Scenario is a shade of blue and the Negative Scenario is shade of Red. I want the shades to be darker for more recent jump-offs, and lighter for older ones. The Legend is a key that combines the Scenario and Jump-off Name. Because I have a legend, there's no conditional formating available. Is there any way to have some kind of conditional logic behind the color/shape selection of the lines?

 

Here is the data:

Name Scenario KeyForecast NameScenarioStart DateRevenue DateRevenue
Q4'21: PositiveQ4'21Positive12/31/202112/31/2021110
Q4'21: PositiveQ4'21Positive12/31/20213/31/2022102
Q4'21: PositiveQ4'21Positive12/31/20216/30/2022104
Q4'21: PositiveQ4'21Positive12/31/20219/30/202298
Q4'21: PositiveQ4'21Positive12/31/202112/31/2022120
Q4'21: PositiveQ4'21Positive12/31/20213/31/2023118
Q4'21: PositiveQ4'21Positive12/31/20216/30/2023124
Q4'21: PositiveQ4'21Positive12/31/20219/30/2023125
Q4'21: NegativeQ4'21Negative12/31/202112/31/2021110
Q4'21: NegativeQ4'21Negative12/31/20213/31/2022108
Q4'21: NegativeQ4'21Negative12/31/20216/30/2022100
Q4'21: NegativeQ4'21Negative12/31/20219/30/202292
Q4'21: NegativeQ4'21Negative12/31/202112/31/202293
Q4'21: NegativeQ4'21Negative12/31/20213/31/202384
Q4'21: NegativeQ4'21Negative12/31/20216/30/202378
Q4'21: NegativeQ4'21Negative12/31/20219/30/202380
Q1'22: PositiveQ1'22Positive3/31/20223/31/2022100
Q1'22: PositiveQ1'22Positive3/31/20226/30/2022105
Q1'22: PositiveQ1'22Positive3/31/20229/30/2022110
Q1'22: PositiveQ1'22Positive3/31/202212/31/2022120
Q1'22: PositiveQ1'22Positive3/31/20223/31/2023119
Q1'22: PositiveQ1'22Positive3/31/20226/30/2023109
Q1'22: PositiveQ1'22Positive3/31/20229/30/2023121
Q1'22: PositiveQ1'22Positive3/31/202212/31/2023130
Q1'22: NegativeQ1'22Negative3/31/20223/31/2022100
Q1'22: NegativeQ1'22Negative3/31/20226/30/202290
Q1'22: NegativeQ1'22Negative3/31/20229/30/202287
Q1'22: NegativeQ1'22Negative3/31/202212/31/202275
Q1'22: NegativeQ1'22Negative3/31/20223/31/202379
Q1'22: NegativeQ1'22Negative3/31/20226/30/202384
Q1'22: NegativeQ1'22Negative3/31/20229/30/202376
Q1'22: NegativeQ1'22Negative3/31/202212/31/202374
Q2'22: PositiveQ2'22Positive6/30/20226/30/202295
Q2'22: PositiveQ2'22Positive6/30/20229/30/2022100
Q2'22: PositiveQ2'22Positive6/30/202212/31/2022124
Q2'22: PositiveQ2'22Positive6/30/20223/31/2023121
Q2'22: PositiveQ2'22Positive6/30/20226/30/2023104
Q2'22: PositiveQ2'22Positive6/30/20229/30/2023108
Q2'22: PositiveQ2'22Positive6/30/202212/31/2023115
Q2'22: PositiveQ2'22Positive6/30/20223/31/2024120
Q2'22: NegativeQ2'22Negative6/30/20226/30/202295
Q2'22: NegativeQ2'22Negative6/30/20229/30/202290
Q2'22: NegativeQ2'22Negative6/30/202212/31/202291
Q2'22: NegativeQ2'22Negative6/30/20223/31/202384
Q2'22: NegativeQ2'22Negative6/30/20226/30/202373
Q2'22: NegativeQ2'22Negative6/30/20229/30/202367
Q2'22: NegativeQ2'22Negative6/30/202212/31/202369
Q2'22: NegativeQ2'22Negative6/30/20223/31/202472
ActualActualActual 12/31/2021110
ActualActualActual 3/31/2022100
ActualActualActual 6/30/202295

 

 

Here's what I have now (I have manually set the colors):

conditional_scenario_V1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I have an issue when I select a sub-section of forecasts. The colors aren't dynamic so if I select Q4'21 and Q1'22, I would like Q1'22 to be the darkest possible shade of red and blue, but it doesn't do that. It displays as the color that I had hardcoded it to be:

conditional_scenario_V2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is there any way to have conditional color and shape formatting when I have a legend? I am also planning on using a linked table (created using CROSSJOIN) to have a conditional legend for this table, so that I can split the legend by either "Name Scenario Key" or "Forecast Name" - That will allow me to see time series of total or it's sub-parts. Not sure if that will affect the logic. 

 

I would appreciate any help on this! As far as I know, there's no way to have conditional line colors, but hopefully I'm wrong. Thank you!

 

 

 

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @zerosugar ,

As far as I concerned, There are no such visual for your requriement. You can submit a requirement here. Thanks for understanding.

 

Or you can change  the line chart to bar chart, then use conditional formatting.

Power BI line chart marker color conditional formatting - Data Cornering

Conditional Formatting for Color in Bar Chart - Microsoft Power BI Community

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @zerosugar ,

As far as I concerned, There are no such visual for your requriement. You can submit a requirement here. Thanks for understanding.

 

Or you can change  the line chart to bar chart, then use conditional formatting.

Power BI line chart marker color conditional formatting - Data Cornering

Conditional Formatting for Color in Bar Chart - Microsoft Power BI Community

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.