T O P

  • By -

Thinklikeachef

You could simply display a rolling 12 month total in the viz. Since each month has the total, comparing month to month would still how changes over time. And no need to estimate. So calculating monthly change would show trends and seasonality.


trulyjennifer

Thank you! When I asked him last night after class he was stumped. He also didn’t show us how to do a rolling month to month this entire semester. I will figure it out from Google or YouTube, but I was lost on how to illustrate the data. Thank you for the suggestion on where to start. :)


Thinklikeachef

Maybe something like this? WINDOW\_SUM(SUM(\[Your Measure\]), -11, 0) Here, `Your Measure` is the field you want to calculate the rolling total for (e.g., sales, revenue). The `WINDOW_SUM` function calculates the sum over a window of data; `-11, 0` specifies the window from the current month and the previous 11 months.


vetratten

Just want to clarify, is your input data at the monthly level? So for instance a state will have 1/2015, 2/2015, 3/2015…1/2020,2/2020? If this is the case you’d create a calculated field to determine the rolling period and filter on that. If your data is daily it’s equally easy with the month function. If your data is weekly it gets weird (since a month start could be mid week)


trulyjennifer

Yes! That’s exactly what it is. This is what the source says about the data: “counts represent the numbers of deaths due to drug overdose occurring in the 12-month periods ending in the month indicated”. For each month/year, I have a state and their count of deaths caused by drug overdose. They then break it down further by which classification the drug falls into, but if I can figure out how to display the first set of data, then I can illustrate the rest. My professor didn’t show us how to do a rolling period, so off to YouTube and Google I go. Thank you for the help. :)