Forum Discussion

Daviejoe's avatar
Daviejoe
Icon for Memorable Member rankMemorable Member
6 years ago

Dynamic Date in Calculate

Hi,

 

My measure below gives me the end of total for last year, which is what i need for now as the first iteration of my report will have a static front page.

 

However, I'm sure I'll get asked to make my calculation dynamic.  How do I make my DATESYTD(ENDOFYEAR(DATEADD('Date'[Date], -1, YEAR )), "31/12" section of my code so it reflects one previous to the year selected in the Date Filter?

 

Measure =
CALCULATE (
    COUNTROWS ( MyTable ),
       FILTER ( MyTable, MyTable[MyColumn] = "Yes" ),
       DATESYTD(ENDOFYEAR(DATEADD('Date'[Date], -1, YEAR )), "31/12")
)

5 Replies