Is it best practice to include current month or only previous completed months in monthly average equation? - average

I am trying to calculate a rolling "monthly average" equation for personal expenses and wondering if I should include the current month before it is over or if I should only include previous, fully completed months?
For instance, in mid-September, should I include January - August OR January - September and so on?

Related

Sum between Dates dynamically

I want to calculate SUM of my data with monthly cycle start date 26 and end date of 25 of each month. Could you please help me out on this?
File Link is below for your reference.
https://drive.google.com/file/d/1nnXGQ5T6ayHl7O6nfUD6BOhl7FaWTCSG/view?usp=share_link
Actually I am trying to draw S-Curve Month Wise with Cut-off date: 25 of each month.
I have data for each day and I want to sum that data month wise with starting from 26 of the month and ending with 25 for each month to get data month wise.

Is there a recommendation or norm on how to add months to a date when there is carry?

ISO-8601 defines time intervals, for example P1M is one month.
However it seems that is does not mandate how to determine what day is one month from a given date.
I looked up the documentation of sqlite and in their implementation, given YYYY-MM-DD, adding one month is adding 1 to MM, and then normalizing (if MM is greater than 12, then increment years, then if DD is greater than the number of days of the resulting month, then carry to next month).
However this can produce inconsistencies:
2020-01-29 + P1M = 2020-02-29
2020-01-30 + P1M = 2020-03-01
2020-01-31 + P1M = 2020-03-02
2020-02-01 + P1M = 2020-03-01 ‽, note that this this is sooner than previously
Moreover, with this method, if I specify an interval of one month and one day, should I first add one month, then one day, or should I add first one day, then one month?
2020-01-30 + P3D + P1M = 2020-02-02 + P1M = 2020-03-02
2020-01-30 + P1M + P3D = 2020-03-01 + P3D = 2020-03-04, so later if we add months first
The question is: is there anywhere a canonical way to proceed when adding an interval to a date, when the interval specifies years or months, which are variable durations?
The actual implementation of the term month in interval form is left mostly unspecified in most, if not all, standards on purpose.
The loosely accepted definition is about 30 days. The integer rounding of 365.25 / 12.
The method used varies on several factors:
Simplicity and Convenience:
It is easier to remember common days.
My electric bill is due on the 11th of every month. This is problematic when day is greater than 28.
I get paid the last day of the month.
The meeting is on the second Tuesday of each month.
Ease of calculation:
Fixed Month definition.
30 day grace period for new purchases.
Astronomical:
Lunar Based:
My apologies for the poorly condensed descriptions.
Synodic: Based on phases of the Moon: 29.18 to about 29.93 days(formed the basis of our modern system)
Sidereal: Based on "fixed" star passing. 27.321 days
Tropical: Based on celestial bodies at the Spring(northern hemisphere) Equinox: 27.321 days
Anomalistic: based on angle off of the elliptic orbit: 27.554 days
Draconic: based on angle off of the elliptic plane: 27.212 days
An even solar month would be:
About 365.2422 / 12 ~= 30.43685 days
An even calendar month would be:
Non-leap years: 30.4166666667 days
Leap years: 30.5 days
Or in terms of Weeks:
Just over 4 Weeks.
This is not meant to be an exhaustive list. There are many more historic or esoteric definitions not included here.
If I have missed one in use today, please let me know.
The main take away is that no single definition fits all purposes.
Be consistent and transparent:
Pick one and stick with it.
Let everyone know.

How to compare current period and previous period in MTM in Tableau?

For example: if we choose January 2020 then it should give the comparison of the previous month which is December 2019 and if we choose 2 months then the last 2 months need to be compared.

Dates, Days, Weeks, Difference, Training&shift start formula

Data shared in Google sheet found here:
I am trying to solve a quick issue to calculate the number of training days and working shifts days spent in a small range of calendar week based on a given 'training start date' and the below criteria:
Weeks are Sunday through Saturday
Each new agency staff should complete 4 days of training before being planned to work for a max of 6 days in and one calendar week
When less than 4 training days are completed during the first calendar week, the remaining roll over to the following, immediately followed by working days but not exceeding 6 days of work or training
To exclude Christmas day
Calculated from the given date for "Training start' calculate how many training shifts and working shifts for a period of calendar weeks
Calendar Weeks based on start/finish dates in the "dates' tab
Any advice, feedback or assistance in any way is greatly appreciated.

Average Volume Every Weekday In a Month Tableau

I am trying to calculate an expression in Tableau 10.2 for a contact center use case.
I have calls at every hour all days of the week.
I need to calculate the average call per hour per day. For instance i need to calculate the average call every Sunday at 9 pm and use that in tool tip.
By this i am measuring how many average calls we get on a given Sunday or any other day of the week at a particular hour.
I had written an expression sadly that is not resulting in accurate number
AVG({ FIXED [Weekday Flagging],[Hour]:
AVG([Volume])})
Do suggest.
Very Recently I had a same requirement to see avg visitors on the hours of all the days of a week. My requirement was (Total No. Of Visitors on Sundays/No.Of Sundays) and then (Total No of Visitors #hour/No. Of Sundays).
1)create a calculated field : sum(volume)/countd(date) and name it 'Avg Volume'
2)drag date to 'Columns'. From the drop down click 'More' -> 'Weekday'
3)drag the calculated field to rows. This will give avg volume on each days of a week.
To get Avg Volume of hours
1)do the same procedure as above and instead of 'Weekday', drag Hour of the day to the column.
Link these 2 sheets using an action filter, so that if u click on sunday in the first sheet, it will show the avg volume of each hour of sunday in the second sheet.