Forum Discussion
Anonymous
6 years agoNot applicable
Year formula - dynamically changing
Hey all, I'm kindly ask for a little help regarding a calculated column or a metric. I need to create a field which to show me (to filter) data only for the last available completed year. For exam...
- 6 years ago
Perhaps:
Measure = VAR __Year = YEAR(TODAY()) RETURN SUMX(FILTER('Table',YEAR([Date]) = __Year - 1),[Column]) - 6 years ago
In case you calendar end in the same year or date is selected
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Measure =
var _max = year(Today())-1
Return
CALCULATE(SUM(Sales[Sales Amount]), Year(Sales[Sales date]) =_max)
or
Measure =
var _max = year(Today())-1
Return
CALCULATE(SUM(Sales[Sales Amount]), Year(Date[Date]) =_max)
Greg_Deckler
6 years agoCommunity Champion
Perhaps:
Measure =
VAR __Year = YEAR(TODAY())
RETURN
SUMX(FILTER('Table',YEAR([Date]) = __Year - 1),[Column])Anonymous
6 years agoNot applicable
Hi Greg_Deckler
Thank you for the response. It helps and the task has been done.