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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Craig3TCE
Frequent Visitor

Change colour of line based on future dates

Good morning all,

I have a data feed from SQL Server of bank transactions. These are plotted on a line chart with the quick measure "Running total" which works just as I want.

All Transactions.PNG

The data feed also includes future transactions and projections from our acounts team. What I'm wanting to do, is represent the future transactions/projection as a different colour.

To do this, so far I've tried creating a Measure that takes todays date and if the transaction is greater, label it "Projection" else "Actual. This won't let me place the Measure in the legend of the chart.

Then I created a CASE statement in the SQL query. This allows me to place the new column in the legend, but the running total gets reset.

Projected Transactions.PNG

Putting the data into a table shows that the running total does indeed get reset for future dates which it doesn't before the case statement.

Balance ActualProjected.PNG

 

Balance All.PNG

Does anyone have any ideas on how to fix this?

 

Thank you in advance,

Craig

1 ACCEPTED SOLUTION

Working.PNGI've managed to solve this by taking the "Running Total" element back to the SQL Query by using an OVER clause. Now the CASE statement doesn't reset the running total and I have the output needed

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Craig3TCE , have you tried actual and project as legend. Without break of the line, it is not possible to have two different colors

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This is what gives the result screenshotted above with the broken line and what's represented in the table where when adding the CASE statement, resets the running total calculation based on the "Quick Measure" which worked perfectly fine before.

Working.PNGI've managed to solve this by taking the "Running Total" element back to the SQL Query by using an OVER clause. Now the CASE statement doesn't reset the running total and I have the output needed

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors