Forum Discussion
Anonymous
2 years agoNot applicable
How to Show MTD calculation ?
Dear All, I have a logic where I have to show data for MTD period. Sum (Sales) where Date should be between 1st of the current system/selected month till max date of the selected date/Filter....
- Anonymous2 years ago
Hi Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
Date = CALENDARAUTO()(2) We can create measures.
Measure 3 = var _date=SELECTEDVALUE('Date'[Date]) var _date_start=DATE(YEAR(_date),MONTH(_date),1) RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date_start && 'Date'[Date]<=_date))Measure 4 = var _date=DATE(SELECTEDVALUE('Date'[Date].[Year]),SELECTEDVALUE('Date'[Date].[MonthNo]),1) var _date_end=EOMONTH(_date,0) RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Date'),'Date'[Date]>=_date && 'Date'[Date]<=_date_end))(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
audreygerred
Super User
2 years agoHello! You can use the TOTALMTD DAX Function to achieve this. You can enter it manual or use quick measures. The below measure assumes you have a measure for Sales and a date table.