Forum Discussion
Dynamic columns in table or matrix visualization
Hi vfh_2023,
Did you mean to dynamic rename these date fields based on current system date? If that is the case, you can try to enter to query editor to add rename column step based on M query functions.
Before
After
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column2", Date.ToText(Date.From(DateTime.LocalNow()),"MMM-yy")}, {"Column3", Date.ToText(Date.AddMonths(Date.From(DateTime.LocalNow()),1),"MMM-yy")}, {"Column4", Date.ToText(Date.AddMonths(Date.From(DateTime.LocalNow()),2),"MMM-yy")}})
Regards,
Xiaoxin Sheng
Thank you very much for this information, but my problem does not come from wanting to change the name of the column dynamically, but when adding the columns in a visualization, since when changing the name every month, this will give me an error at the time that the name of that column is another.
- Anonymous3 years agoNot applicable
Hi vfh_2023,
>>but when adding the columns in a visualization, since when changing the name every month, this will give me an error at the time that the name of that column is another.
I think this is an expected issue if the source table field names will change dynamically.
AFAIK, the query tables will cache the table structure(fields name, type) into the steps, and they did not synced fields names when the source fields name changes.
Regards,
Xiaoxin Sheng