Forum Discussion
Dom87326
5 years agoHelper II
Dynamic Title With Time Intelligence
Hello,
I have date table, date column 1:* fact table, date column. Two donut chart, left showing this year's data, other last years.
I try to add dynamic titles for two donuts, i.e. for curent year I managed to come up:
Date Card = "Date range:"&" "&FORMAT(MIN ( 'Date'[Date] ), "MMM/YY") & " to "
& FORMAT(MAX ( 'Date'[Date] ), "MMM/YY")
Could you please let me know how to do that with last years title? I need that it would go back one year based on filter context.
Many thanks!
Dom87326
Last Year label:LY Date = VAR __MIN = CALCULATE( MIN(Dates[Date]) , SAMEPERIODLASTYEAR(Dates[Date]) ) VAR __MAX = CALCULATE( MAX(Dates[Date]) , SAMEPERIODLASTYEAR(Dates[Date]) ) RETURN "Date range: " & FORMAT( __MIN , "MMMM/YY") & " TO " & FORMAT( __MAX , "MMMM/YY")