Forum Discussion

mickey2021's avatar
mickey2021
Advocate I
4 years ago

Change column header names dynamically in a table visual

Hello everyone, 

I am trying to find a way to dynamically update the column header names in a tabular table visual as soon as possible. Currently, I have a table called Product and it has a lot of columns where some of their column names need to get dynamically updated every month/quarter. I was able to write some M codes in the query editor to dynamically change column header names there and apply the changes, but I failed to find a way to do the same outside of query editor in the table visual. 

 

Below is an example of the original table: 

Product Category Country Non Shipped Quantity Q1 2021Non Shipped Quantity Q2 2021BackOrderQuantity October 2021

BackorderQuantity

November 2021

HeadsetUSA121234
ComputerUK3421

 

Below is the output of what I am looking for. The last four column headers' name inside the table visual should automatically gets dynamically changed when they gets updated inside the query editor. 

Product Category Country Non Shipped Quantity Q3 2021Non Shipped Quantity Q4 2021BackOrderQuantity November 2021

BackorderQuantity

December 2021

HeadsetUSA121234
ComputerUK3421

 

Based on my research, I learned that there is currently no such feature to dynamically change the column header names inside the table visual (please correct me if my understanding is wrong). I also looked into options of using matrix by unpivoting the columns first inside query editor and pivoting them inside matrix in the table. However, in my scenario, I don't think matrix is a doable option for me because matrix can only do one column's pivoting at the same time but I have multiple columns that I need to pivot. 

 

I also looked into possibility of using Dax or other approaches to handle it but haven't really found a way to handle my situation above. 

 

May I get some help here to see how I can approach this to dynamically update the column header names, please? 

 

Thank you! 

 

 

8 Replies