Forum Discussion
Dynamic Column Name
Hello,
I have a table as shown below. I have to plot the data in Grid, but column needs to be actual year. Every Year, Year will increment such as current Year + 1, + 2, and so on. So I cannot simply change the Colum Header. Table Field Names will not change in the Database. Is there a way in M-Query to change teh column nae such as YEAR(Now()), YEAR(Now()) +1 and so on. Please advice how to accomplish this?
sabeensp see attached, look at table called Table in power query and it take the current year as a base and then replaces column names accordingly. It can be improved further but I think it is a good start.
7 Replies
- selpaqmHelper V
Hi,
did you try to change it from Transform Data section.
On home section click Transform data, then choose related table from queries section. change the table column headers with double click on it or just right click and rename it. this will be added to Applied steps section and even you refresh the data it will replace them by itself.