Forum Discussion
Anonymous
7 years agoNot applicable
Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions
I create three calculated Tables from my Date Dimension Table 'Order Date' and I see different days than expected. Table 1 = DATESYTD('Order Date'[Date]) Table 2 = DATEADD(DATESYTD('Order Date'[Dat...
Anonymous
7 years agoNot applicable
If "Order Dates' is A REAL DATE TABLE IN THE MODEL, then this is what you want:
[Dates YTD Up to Today] = var __today = today() RETURN CALCULATETABLE( DATESYTD( 'Order Dates'[Date] ), 'Order Dates'[Date] <= __today ) [Dates YTD Up to Today Shifted 1 Year Back] = var __today = today() return CALCULATETABLE( SAMEPERIODLASTYEAR( DATESYTD( 'Order Dates'[Date] ) ), 'Order Dates'[Date] <= __today )
Best
Darek