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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
DEngel
New Member

Table Transformation - Column Names into Repeated rows

BI Experts,

 

I am attempting to perform a batch import of excel files from a folder where the native data structure for one table is:

 

Service NameSales Person ASales Person XSales Person Y
Service A102030
Service B405060
Service C708090

 

Where what I would like to do is transform this into a 3 column matrix such as for the first example file:

Service NameSales Person NameRevenue
Service ASales Person A10
Service ASales Person X20
Service ASales Person Y30
Service BSales Person A40
Service BSales Person X50
Service BSales Person Y60
Service CSales Person A70
Service CSales Person X80
Service CSales Person Y90

 

Unfortunately, I am running into a few challenges:

1. A way to re-structure this data for a singular file (I.E. importing just a singular file - outside of a brute force approach)

2. A way to do so that is tolerant to each file having a different set of initial values for the column names

3. A way that allows for "X" number of services, and "Y" number of sales people

 

I hope there is an elegant DAX method that can perform this type of transformation simply.

 

Thanks in Advance,

David

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hey @DEngel ,

 

I think that if you bring in the data as shown in the first image and then do a transpose or pivot on the columns after the first one you should be able to get the result that you want.

 

I took this:

collinq_0-1734060855040.png

I selected the first column and unpivoted the other ones:

collinq_1-1734060907545.png

and got this

 

collinq_2-1734060951417.png

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

2 REPLIES 2
collinq
Super User
Super User

Hey @DEngel ,

 

I think that if you bring in the data as shown in the first image and then do a transpose or pivot on the columns after the first one you should be able to get the result that you want.

 

I took this:

collinq_0-1734060855040.png

I selected the first column and unpivoted the other ones:

collinq_1-1734060907545.png

and got this

 

collinq_2-1734060951417.png

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




Thanks a ton Collin, that worked perfectly to be able to manage one file.

 

I am working through a couple of issues with file structures varying (between each) and having to manage to use techniques like that stated here: Solved: Replacing a specific value in ALL cells, without h... - Microsoft Fabric Community

 

Unsure if you know of a similar approach for replacing errors for all columns.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors