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 have a requirement to dynamically change year columns in a table.
I am looking to create calculated columns with dynamically changing titles. Eg. '2024 Review' for this year, dynamically change to '2025 Review' next year and so on.
Is there a way I can achieve this in Power BI?
Solved! Go to Solution.
Hi @Pragadeesh - Got it,
Below is the link for your reference:
Solved: How to dynamically change columns in a Matrix or C... - Microsoft Fabric Community
Please try the above approach and let know.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi @rajendraongole1 , @AnushaSri ,thank you for your quick reply, I will add more.
Hi @Pragadeesh ,
The Table data is shown below:
Please follow these steps:
1.Unpivot the following columns.
2.Use the following DAX expression to create a table
Table 2 = ADDCOLUMNS({YEAR(TODAY()) & " " & "Delivery",YEAR(TODAY()) - 1 & " " & "Delivery",YEAR(TODAY()) - 2 & " " & "Delivery"},"Year",VALUE(LEFT([Value],4)))
3.Create a relationship between two tables
4.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Pragadeesh,
If I correctly understood, you are trying to create a calculated column for dynamically changing year names.
For this you can try this calculation based on any of the date/year column of the table as below.
Add a Calulated Column to your table using the below DAX sample.
Please accept this a a solution if it helps to resolve your issue. also please give Kudos.
Thanks in advance 🙂
Hi @Pragadeesh - Create a DAX measure to calculate the current year. This measure will give you that the column titles are always based on the current year.
CurrentYear = YEAR(TODAY())
Now you can create a Calculated column or new column that generates the dynamic column title based on the current year.
DynamicTitle =
VAR CurrentYear = YEAR(TODAY())
RETURN
CONCATENATE(CurrentYear, " Review")
Use this measure Dynamic title in your table chart title (fx) and choose
It works, Please check.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi @rajendraongole1 , thank you for the response.
But the requirement I'm facing is to dynamic change column names and not the table name. Please find the attached table below
The delivery year should change with every passing year.
Hi @Pragadeesh - Got it,
Below is the link for your reference:
Solved: How to dynamically change columns in a Matrix or C... - Microsoft Fabric Community
Please try the above approach and let know.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
168 | |
116 | |
63 | |
57 | |
50 |