Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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"
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |