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
Anonymous
Not applicable

Unpivoting?

Hi all! I've been scratching my head with the following modeling issue... I am importing a Sharepoint List of employees located in different sites... The structure of this list is:

- one site per row

- up to 32 groups of columns with details for up to 32 employes on each site:

  • Staff1_Name, Staff1_Email, Staff1_tel, Staff1_job,
  • Staff2_Name, Staff2_Email, Staff2_tel, Staff2_job...

I'd need to "somehow" modify the query so that I would end up with the following structure:

- one site+employee per row

- up to 32 rows for one site

- One colum for name, one for Tel, one for email, one for Job, and one as Staff#

 

Any idea? The worst that came to my mind is to duplicate 32 times this initial query, keeping only one Staff in each duplicated query, and then merge back the 32 queries... pretty weird, right?

 

Thx for your inputs,

Ben

Capture.JPG

1 ACCEPTED SOLUTION

@Anonymous

 

Hi, Try with a combination of Unpivot & Pivot.

 

Check the PBIX.

 

PD: If you want to mantain the Staff 1,2,3...

 

Do This:

 

Staff.png

 

 

Regards

 

Victor




Lima - Peru

View solution in original post

4 REPLIES 4
Aron_Moore
Solution Specialist
Solution Specialist

Unpivot should get you real close. Using a sample dummy set I selected all non-site columns and click unpivot. Viola!

 

Capture.PNG

 

In query editor

Capture1.PNG

Result:

Capture2.PNG

 

 

Anonymous
Not applicable

Hi Aron,

thx for your input, but it doesn't solve the issue I'm afraid, as this puts for instance for Staff1 the attributes in different rows, whereas we want them in column... 😞

@Anonymous

 

Hi, Try with a combination of Unpivot & Pivot.

 

Check the PBIX.

 

PD: If you want to mantain the Staff 1,2,3...

 

Do This:

 

Staff.png

 

 

Regards

 

Victor




Lima - Peru
Anonymous
Not applicable

Vvelarde, this is exactly it, thx!!!!!!!

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.