Calculating Month-To-Date and Week-to-Date (2024)

Hi Rsanjuan,

I think the formula for month and week won’t work here, and as you concerned, the formula can’t identify which year the month belongs to, also for the week.

For the Previous sales, the formula posted might not be the correct one, see the testing results, the formula used are all copied from the posted ones:

Calculating Month-To-Date and Week-to-Date (1)

Which I think should be the correct one is the following:

SalesYTD =

TOTALYTD (

[TotalSales],

'Date'[Date]

)

And:

SalesLastYear =

CALCULATE([TotalSales], DATEADD(DATESYTD('Date'[Date]),-1,Year))

Those two formula need a date table to work with.

For month total and Week total, see:

"

Iso MTD :=

IF (

HASONEVALUE ( Dates[ISO Year] )

&& HASONEVALUE (Dates[ISO Month Number] ),

CALCULATE (

SUM ( Sales[Sales Amount] ),

FILTER (

ALL ( Dates ),

Dates[ISO Year] = VALUES ( Dates[ISO Year] )

&& Dates[ISO Month Number] = VALUES ( Dates[ISO Month Number] )

&& Dates[Date] <= MAX ( Dates[Date] )

)

),

BLANK ()

)

Iso WTD :=

IF (

HASONEVALUE ( Dates[ISO Year] )

&& HASONEVALUE (Dates[ISO Week Number] ),

CALCULATE (

SUM ( Sales[Sales Amount] ),

FILTER (

ALL ( Dates ),

Dates[ISO Year] = VALUES ( Dates[ISO Year] )

&& Dates[ISO Week Number] = VALUES ( Dates[ISO Week Number] )

&& Dates[Date] <= MAX ( Dates[Date] )

)

),

BLANK ()

)

"

Check details in the the article below:

Week-Based Time Intelligence in DAX

Before using the formula posted in the article, we need to create a date table containing the following columns:

Year, month and week number in a year.

New table function to create a datetable;

Datatable = calendar(MinDate, MaxDate);

Then add the following columns:

Year = year(Datetable[Date])

Month = month (Datetable[Date])

Weeknum = WeekNum(Datetable[Date])

After that, follow the formula mentioned in the blog to generate the YTD, MTD and WTD function.

If any further help needed, please post back.

Regards

Calculating Month-To-Date and Week-to-Date (2024)

FAQs

How to calculate mtd and ytd? ›

Anything in January to July is YTD and also anything from August 1st to August 23 is YTD. Of any Year. MTD – if The date in today's month and the day of the month is smaller or equal to today then it is MTD. Otherwise it is not.

How do you calculate month-to-date? ›

Calculation of Month-to-Date
  1. Start with the first day of the month: Begin by setting the starting point of your MTD calculation as the first day of the current month.
  2. Sum up relevant transactions: Add up all relevant transactions from the beginning of the month to the present date.
Nov 20, 2023

How to do a formula to calculate number of days between two dates? ›

To find the number of days between these two dates, you can enter “=B2-B1” (without the quotes into cell B3). Once you hit enter, Excel will automatically calculate the number of days between the two dates entered. Note that Excel recognizes leap years.

How to calculate mtd percentage? ›

Just like YTD, MTD performance is calculated by subtracting the initial value at the beginning of the current month from the current value, dividing it by the initial value, and multiplying by 100 to get a percentage. Since MTD is such a short period, some organizations also use previous month-to-date or PMTD.

What is the formula for calculating YTD? ›

To calculate the YTD return, subtract the starting period value from the current period value, and divide the resulting figure by the starting year value. In the final step, multiply the figure in decimal notation by 100 to convert the YTD figure into a percentage.

What is the MTD date format? ›

Month till date or Month to date (MTD) is the period starting from the beginning of the current month up until the present date, not including the current date. For example, the MTD for the date 27th May is from 1st May till 26th May.

How to calculate months between two dates? ›

To use the DATEDIF function for calculating months, select the cell where you want to display the result, enter the formula =DATEDIF(start_date, end_date, "m") , and press Enter. The result will be displayed in the selected cell.

What is the MTD target formula? ›

MTD target formula takes the total target, divides it by the total number of work days in the current month, then multiplies the result by the number of work days so far.

How do you calculate average MTD? ›

Calculating a MTD Average based on Date and Entity
  1. Average#MTD = Averagex(values(Table[Date].[Date], [Number]) - returns the Number for each Month.
  2. Average#MTD= CALCULATE(AVERAGEX(Table,Table[Number]),Filter(Table,Table[Date]. [Date]<=EARLIER(Table[Date].
Dec 21, 2020

What is MTD rate? ›

MTD stands for “month to date.” It's the period starting from the beginning of the current month up until now … but not including today's date, because it might not be complete yet.

What's the difference between MTD and YTD? ›

To summarize, the MTD column tracks from the start of the month to the present day and resets every month. The YTD column (which displays as the current year) continues to add up over the year and will only reset on January 1 of the next year. It is what is achieved (history), not a forecast.

What is the formula for YTD in retail? ›

Year-to-date return refers to the profit (or loss) generated by an investment during the year. YTD return is calculated by subtracting the starting value from the current value and dividing it by the starting value. The figure can be multiplied by 100 to convert it into a percentage.

Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 6482

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.