Forum Discussion
YB
4 years agoFrequent Visitor
Need help with TOTALYTD
Hi folks, I have been trying to figure out how to compare measures year over year for the same time period. In this particular case I'd like to get from Jan 1st to Today (including the same time...
- 4 years ago
Ok, I found a solution but it's not very elegant.
YTD Last Year = CALCULATE([Year to Date], DATEADD ('Calendar'[Date], -1, YEAR ), 'Calendar'[Date] <= DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))) YTD 2 Years Ago = CALCULATE([Year to Date], DATEADD ('Calendar'[Date], -2, YEAR ), 'Calendar'[Date] <= DATE(YEAR(TODAY())-2,MONTH(TODAY()),DAY(TODAY())))
YB
4 years agoFrequent Visitor
Ok, I found a solution but it's not very elegant.
YTD Last Year = CALCULATE([Year to Date], DATEADD ('Calendar'[Date], -1, YEAR ), 'Calendar'[Date] <= DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY())))
YTD 2 Years Ago = CALCULATE([Year to Date], DATEADD ('Calendar'[Date], -2, YEAR ), 'Calendar'[Date] <= DATE(YEAR(TODAY())-2,MONTH(TODAY()),DAY(TODAY())))
- CNENFRNL4 years agoCommunity Champion
YTD Last Year = CALCULATE( COUNT( 'TEST'[id] ), DATEADD( DATESYTD( 'Calendar'[Date] ), -1, YEAR ) )- YB4 years agoFrequent Visitor
Unfortunately, this does not work and it is very similar to what I was already attempting before. This will include all dates in October of last year not just up to the 5th (today).
- CNENFRNL4 years agoCommunity Champion
YTD Last Year = CALCULATE( COUNT( 'TEST'[id] ), DATEADD( CALCULATETABLE( DATESYTD( 'Calendar'[Date] ), 'calendar'[Date] <= today ), -1, YEAR ) )