Forum Discussion
Dynamic Date Title
Hi,
I want to insert years as a title into a card. Like shown in the picture.
The last card "2022" is always this year. I did this with the formula "=NOW()"
Each year the title should change to the next year.
But I dont know how to set the title for the previous year and the title for two years ago.
Is there a formula, with which i can just say: "Give me this year minus 1 year ?
Thanks in advance.
Best regards.
If you want a date you a year ago you can create the following measure:
Date a Year Ago = DATE(YEAR(TODAY())-1,MONTH(TODAY()), DAY(TODAY()))
10 Replies
- amitchandakSuper User
Anonymous ,measure or column as per need
This Year = year(Today())
Next Year = year(Today()) +1
Last Year = year(Today()) -1
- AnonymousNot applicable
Thank you for your fast reply.
But I still get strangely 1905 for the last year.- Tahreem24Super User
Anonymous Can you share screen shot of your date column and check which data type it is.
- AnonymousNot applicable
Hi Anonymous,
Try using the PREVIOUSYEAR() function along with the YEAR().
Here's the documentation: PREVIOUSYEAR function (DAX) - DAX | Microsoft Docs
I hope it helps