I have data as Follows (SAMPLE):

The thing that I would like to achieve is additional metric of 30-Day Moving average of along with the Daily Total of WorkOrders
Sample of what I have already achieved in Data Studio:

Along with it, I want Pseudocode
SUM ( Order
WHEN
DATE =( DATEBETWEEN ( CurrentRowDATE , CurrentRowDate - 30) )
) / 30
This would be the Average of Orders Per Day for the Past 30 Days.
Would Really Appreciate any Pointers. Appreciate your help in Advance.
You can do this by blending your data source with itself using a cross join. I used this sample data on Google Sheets:

Created the join:

Then created the table:

The formula for creating the running average:
SUM(
IF(
date (Table 2) BETWEEN DATETIME_SUB(date (Table 1), INTERVAL 2 DAY) AND date (Table 1),
orders (Table 2),
0
)
) / 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With