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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors