March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
Solved! Go to Solution.
If you want a date you a year ago you can create the following measure:
Hi @Nanaki,
Try using the PREVIOUSYEAR() function along with the YEAR().
Here's the documentation: PREVIOUSYEAR function (DAX) - DAX | Microsoft Docs
I hope it helps
@Nanaki ,measure or column as per need
This Year = year(Today())
Next Year = year(Today()) +1
Last Year = year(Today()) -1
Thank you for your fast reply.
But I still get strangely 1905 for the last year.
@Nanaki Can you share screen shot of your date column and check which data type it is.
In the first picture you can see the formula "today" with the today date.
And in the 2. picture with "year(today)" i get the year 1905.
Hi @Nanaki,
13-7-1905 is the date value of number 2021. You can see this e.g. in Excel by changing the format into Short Date of a cell containing 2021.
I can reproduce the behaviour you experience when I create a new column instead of a measure
Defintions:
Solution is then to create a measure with that definition.
But with that solution I wont get the year 2021 in a date format right? Only in a number format ?
If you want a date you a year ago you can create the following measure:
Awesome, this worked. Thank you very much to all of you!
I dont have a column, I just have this formula. I created it manually as a measure and wanted to insert it into one card.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
202 | |
137 | |
106 | |
70 | |
68 |