Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Powerbi's World !
I have basic question :
Is it possible to rename automatically several fields by year ?
For instance, we are in 2023.
I have fields " Turnover N" , "Turnover N-1" etc.
I replace names of them everytime by "2023", "2022", etc.
It's very long to do that and i am going to be bothered next year when N becomes 2024, N-1 becomes 2023, etc.
Have you got some tips?
Thank you in advance and have a good day !
I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.
Your insights and updates will greatly assist others who might be encountering the same challenge.
Hi,
You can use tabular editor scripting to do this. For example:
Now open C# scripts:
var FromString = "N"; var ToString = "2023"; foreach (var m in Model.AllColumns) { m.Name = m.Name.Replace(FromString,ToString); /* Cycle over all columns in model and replaces the FromString with the ToString */ }
Run the script:
Save changes and go back to model:
We can see the names have changed. Next year you can repeat this but replace N in the script with 2023 and 2023 with 2024.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |