cancel
Showing results for 
Search instead for 
Did you mean: 
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

Regards,
Arul
If I answered your question kindly mark my post as a solution and a kudo would be appreciated.

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

Regards,
Arul
If I answered your question kindly mark my post as a solution and a kudo would be appreciated.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors