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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sabry_303
Frequent Visitor

Column headers to be in rows

Hi Experts,

 

I have the below table for employee availability,  and I would like to have the time in column headers to be in the rows so that Adam has 3 rows for the the 3 periods. Also, I will be updating this file so that dates in the header change and I dont want it to mess the query.

 

Alternate Format NameAvailability % 15 Jan 2023 - 21 Jan 2023Availability % 22 Jan 2023 - 28 Jan 2023Availability % 29 Jan 2023 - 4 Feb 2023
Adam0.00%0.00%0.00%
Shady0.00%0.00%0.00%
Ralf0.00%0.00%0.00%
Will0.00%0.00%0.00%
Sharon0.00%0.00%

0.00%

 

 

Optimal result:

 

Alternate Format NameTime periodAVAILABILITY
AdamAvailability % 15 Jan 2023 - 21 Jan 20230.00%
AdamAvailability % 22 Jan 2023 - 28 Jan 20230.00%
AdamAvailability % 29 Jan 2023 - 4 Feb 20230.00%
ShadyAvailability % 15 Jan 2023 - 21 Jan 20240.00%
ShadyAvailability % 22 Jan 2023 - 28 Jan 20240.00%
ShadyAvailability % 29 Jan 2023 - 4 Feb 20240.00%

 

 

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@sabry_303 ,

1. Go to Power query editor and select these 3 columns in the your table.

Arul_0-1677493126927.png

2. Right click on any of the selected columns and do unpivot columns.

Arul_1-1677493190308.png

3. You will get the desired result.

Arul_2-1677493224082.png

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


View solution in original post

1 REPLY 1
Arul
Super User
Super User

@sabry_303 ,

1. Go to Power query editor and select these 3 columns in the your table.

Arul_0-1677493126927.png

2. Right click on any of the selected columns and do unpivot columns.

Arul_1-1677493190308.png

3. You will get the desired result.

Arul_2-1677493224082.png

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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