Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
I need help making the second part of the statement below dynamic so that it reflects current year appropriately as time goes by.
Solved! Go to Solution.
Hi,
Please try this calculated column:
Tiers =
IF (
YEAR ( 'Table'[Date] )
= YEAR ( TODAY () - 3 ),
"CY",
"PY"
& DATEDIFF ( 'Table'[Date], TODAY () - 3, YEAR )
)
The result shows:
See my attached pbix file.
Best Regards,
Giotto
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
I am trying to avoid hardcoding any years like in the example below.
I want to put a formula instead of an actual year which will provide a respective yearso that I don't have to updates manually the years in the statement every year.
Tiers =
SWITCH (
TRUE (),
'Weekly Data'[Injury_Dte] = 2020, 'CY'
'Weekly Data'[Injury_Dte] = 2019, 'PY 1'
'Weekly Data'[Injury_Dte]) = 2018, 'PY 2'
.....
">PY6"
)
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 51 | |
| 41 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 122 | |
| 107 | |
| 47 | |
| 30 | |
| 24 |