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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nelgnat
New Member

Transform Data on Columns with Changing Names

Hi there,

 

I have an Excel spreadsheet which exports from another source. We will export the Excel file to the same location every time, then refresh the report. I need to Change the Type of some columns, but the column names from one export to the next will change. There are some columns which are named the same every time. Is there a way to identify the columns I want Power BI to change the type for other than manually selecting the Columns by name?

 

For example, my Excel column headers in today's export have the following names, with an example of the values that would follow.

Project NameJune 2023September 2023February 2024
Apple Project Inc.56.532.418.7
Banana Project Ltd.12.19.730.0

 

Next month when we export it, the Excel column headers which contain the dates will likely be different. It does not always shift by exactly one month though, as shown in my example. It could be any month or year in the future.

Project NameSeptember 2023February 2024March 2024
Apple Project Inc.32.418.723.5
Banana Project Ltd.9.730.010.2

 

Regardless of which month or year it is, I need those columns to have a data type of Fixed Decimal. I do not want to manually choose which columns Power BI updates every time we refresh.

Thank you for any help you can offer!

1 ACCEPTED SOLUTION
bolfri
Solution Sage
Solution Sage

Hi, just unpivot those columns to a single column and change the type.

https://learn.microsoft.com/en-us/powerquery-m/table-unpivotothercolumns

 

You will receive something like this:

Project NameMonthValue
Apple Project Inc.June 202356.5
Apple Project Inc.September 202332.4
Apple Project Inc.February 202418.7
Banana Project Ltd.June 202312.1
Banana Project Ltd.September 20239.7
Banana Project Ltd.February 202430.0




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Nelgnat
New Member

Bolfri,

 

Thank you so much!

An added layer of complexity is that there are multiple columns with the same name (July 2023 for example), but one of them contains values for hours, and the other contains values for dollars.

 

I am working with my team to export this information in a different way so we can leverage your solution.

bolfri
Solution Sage
Solution Sage

Hi, just unpivot those columns to a single column and change the type.

https://learn.microsoft.com/en-us/powerquery-m/table-unpivotothercolumns

 

You will receive something like this:

Project NameMonthValue
Apple Project Inc.June 202356.5
Apple Project Inc.September 202332.4
Apple Project Inc.February 202418.7
Banana Project Ltd.June 202312.1
Banana Project Ltd.September 20239.7
Banana Project Ltd.February 202430.0




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.