Forum Discussion
Stelian
2 years agoHelper I
MTD Total
Hi everyone, I have a table with: Column 1 - Date, Column 2 - MTD sales for the current month (e.g., Jan 2024 until the previous day, for example, 30.01.2024), and Column 3 - MTD sales for th...
Anonymous
2 years agoNot applicable
Hi Stelian ,
Please have a try.
For the current year MTD (up to the previous day):
MTD CY =
CALCULATE(
SUM('Actual Sales'[SoldAmount]),
DATESBETWEEN(
DeliveryNoteDateDim[DeliveryNote Date],
STARTOFMONTH(DeliveryNoteDateDim[DeliveryNote Date]),
PREVIOUSDAY(MAX(DeliveryNoteDateDim[DeliveryNote Date]))
)
)
For the last year MTD (up to the previous day of the same month):
MTD LY =
CALCULATE(
SUM('Actual Sales'[SoldAmount]),
DATESBETWEEN(
DeliveryNoteDateDim[DeliveryNote Date],
STARTOFMONTH(SAMEPERIODLASTYEAR(DeliveryNoteDateDim[DeliveryNote Date])),
PREVIOUSDAY(ENDOFMONTH(SAMEPERIODLASTYEAR(DeliveryNoteDateDim[DeliveryNote Date])))
)
)
In these measures, the function is used to specify the range of dates for the MTD calculation. The function helps to exclude the current day's sales from the total, ensuring that the calculation is up to the previous day.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.