Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
rigelng1995
Frequent Visitor

Dynamically Change Column Displayed name

Hi

 

I have a table in SQL that get's refreshed at the start of every month which has the following columns 

 

CustomerID - R6 - R5 - R4 - R3 - R2 - R1 

R1-6 represent their spend classification in text in regards to the current Month - For example today's date is 4th of May, 2020 then R1 represent Classifications in April and R2 for March etc etc.  

 

Some example data

10000000 -- High - Low - High - Low - High - Low

10000001  -- Low  - Low - Low -Low -Low - High

 

Once I Imported this table into powerBI I can display such information in a table (Visual)

-- However I want the column names  shown in the table to be have 202004, 202003 displayed instead of R1 - R6.  

 

1.) If I change the underlying sql script so that the column names are changed dynamically at the start of every month then it won't refresh because the same column names cannot be found by next month in the displayed table.

2.) However if I leave it at R6-1 then I have to go to the displayed tables and changed the column names one by one every month. 

 

Is there a more intelligent way of doing it?

 

Thanks

Rigel  

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rigelng1995 , refer, if these can value

https://community.powerbi.com/t5/Power-Query/Dynamic-Column-Names/m-p/862358

https://www.youtube.com/watch?v=fSHcLxA9rY4

https://www.youtube.com/watch?v=yEemVBiaTuk

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@rigelng1995 , refer, if these can value

https://community.powerbi.com/t5/Power-Query/Dynamic-Column-Names/m-p/862358

https://www.youtube.com/watch?v=fSHcLxA9rY4

https://www.youtube.com/watch?v=yEemVBiaTuk

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Users online (2,350)