01-06-2017 01:52 PM
I want to do Month to date and year to date calculation without using MTD and YTD functions. I know Today() stands for Today's date. In the same lines can someone please tell me how do I get the first day of current month (example 1/1/2017 currently) and first day of current year? TIA.
Solved! Go to Solution.
01-06-2017 05:26 PM
Cool my dear friend ,
try this one.
It will give u the first date from the date.
If u choose month it will give u the start of month, if u select year it will give start of year.
let me know if any help.
01-07-2017 01:37 AM
This is a way to easily calculate MTD and YTD without the need to calculate the first days first:
[SalesYTD] := CALCULATE ( [Sales], FILTER ( ALL ( 'Date' ), 'Date'[Year] = MAX ( 'Date'[Year] ) && 'Date'[Date] <= MAX ( 'Date'[Date] ) ) )
Taken from DAXPatterns here: http://www.daxpatterns.com/time-patterns/