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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wimsattj
Frequent Visitor

How can I dynamically change an imported table's column names to update each month?

I have a report that I'm semi-automating from an excel/powerpoint to a powerBI dashboard. The old SQL required me to change column names every month, but now they are listed as "Month1_Collections" - "Month12_Collections"

This allows me to import the tables more readily into powerBI, but now I am stuck with column headers that don't easily display which month this is in reference to. I don't want to have to individually relabel visualizations as I go. I'm hoping that there is a way to have my columns update during each month's refresh.

Is there a way that I can have the column headers dynamically update each month? For instance, when I load the data in July 2023, the "Month1_Collections" will read as "June2023_Collections" and "Month12_Collections" will read as "July2022_Collections"?

1 REPLY 1
cpearson
Resolver I
Resolver I

Difficult to know how to approach this without understanding a bit more about the data. However if I were you I'd look at unpivoting the columns (either in SQL, or using Power Query when importing) so that you can get a column with the MonthN_Collections values in them e.g. the black columns below:

 

Col1Col2Month_CollectionValueMonth
X1Month1_Collection100Jun-23
X2Month1_Collection130Jun-23
X1Month2_Collection25Jul-23
X2Month2_Collection500Jul-23
Y1Month3_Collection45Aug-23

 

Once you've got that structure, can you add a column to calculate what the true month header (like the red column)? If so you can do that and then use a Matrix table visual to pivot that back to be the variable column headers you are looking for.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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