# Velocity / Trend line in Charts

I’m curious if anyone has solved the puzzle of creating a trendline for their line charts yet? I’m a frequent user of line charts for burndowns in project tracking, but the most important part of them is the trendline / average velocity line - I’ve been puzzling over it for a bit tonight, but my brain is to fried to think in terms of derivatives AND coda tables, so I’m throwing this one to the community gods

Thanks!

2 Likes

I suspect you can create an extra column that represents the running sum/total and graph that. (There are several posts on how to create this)

This question has come up a few times through various channels, so I put together a quick doc to show how you can create a trend line.

Here’s the formula used in the example doc.
`(thisTable.[Tasks Left].Max() / (thisTable.Date.Max().ToDate() - thisTable.Date.Min().ToDate())) * (thisTable.Date.Max().ToDate() - thisRow.Date.ToDate())`

4 Likes

Hi @BenLee,

Thanks for the input on this - I greatly appreciate it.

Unfortunately, your trend line is incorrect - You can tell at a glance of your line chart, as the trend line is supposed to be the moving average of the data set, and therefore cut straight through the “middle” of your curve, like this:

I’ve gone ahead and made one that calculates in ways that I’m quite happy with (based upon this math, if you’re curious: https://study.com/academy/lesson/what-is-a-trend-line-in-math-definition-equation-analysis.html)

It’s here for you guys to view (although I really should condense the math columns into one formula):

2 Likes

Dear @Keith_Guerrette,

Thanks a lot sharing this material, including math explanation
Recently I received a similar question and to be honest, I felt “how I am going to solve this”

You’re right! You said Trend and I created a Target line. My bad there.

Thank you very much for sorting out the Trend line!

I’ve been too lazy to create this myself and the use case was merely for personal visualization of greater trends in my stats. This is perfect!

I just wanted to post that this trendline component has a massive flaw - the purpose of a trendline is to predict the future, however, I cannot for the life of me figure out a way to create this trendline for data with no X axis entries.

Ultimately, this is far past my expertise - can anyone else hop in to help?

Thanks for this. I think I’ve managed to condense it further for those interested.

1 Like

Hi @4degrees,

Thanks for posting this solution. I tried copying the doc and a formula isn’t showing up, it’s just data. Would you be able to double check and see that the formula is there or post it here? Curious what you used