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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
threw001
Helper III
Helper III

Manipulate table and move columns to be in row format

Hi guys,

 

I have the below table where I have columns going across for each day (hours worked).

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjBU0lEyAGIjIDaDsk2UYnWilQwNoFxTuDBcyghJGIFjYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EmployeeID = _t, #"Monday Hours" = _t, #"Tuesday Hours" = _t, #"Wednesday Hours" = _t, #"Thursday Hours" = _t, #"Friday Hours" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"EmployeeID", Int64.Type}, {"Monday Hours", Int64.Type}, {"Tuesday Hours", Int64.Type}, {"Wednesday Hours", Int64.Type}, {"Thursday Hours", Int64.Type}, {"Friday Hours", Int64.Type}})
in
    #"Changed Type"

 

 

I would like to change this table to the below. Employee ID is repeated going down based on each day and the no. of hours. Can you please advise?

EmployeeIDDayHours
1Monday Hours0
1Tuesday Hours2
1Wednesday Hours6
1Thursday Hours0
1Friday Hours4
10Monday Hours0
10Tuesday Hours5
10Wednesday Hours0
10Thursday Hours4
10Friday Hours4
12Monday Hours5
12Tuesday Hours0
12Wednesday Hours0
12Thursday Hours0
12Friday Hours0

 

Thanks

1 ACCEPTED SOLUTION
gmsamborn
Super User
Super User

Hi @threw001 

 

In Power Query:

Select the EmployeeID column, right-click and Unpivot Other Columns.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

3 REPLIES 3
gmsamborn
Super User
Super User

Hi @threw001 

 

In Power Query:

Select the EmployeeID column, right-click and Unpivot Other Columns.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!
ryan_mayu
Super User
Super User

could you pls provide some sample data?





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

Proud to be a Super User!




Hi @ryan_mayu 

Sample data below for Power Query.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjBU0lEyAGIjIDaDsk2UYnWilQwNoFxTuDBcyghJGIFjYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EmployeeID = _t, #"Monday Hours" = _t, #"Tuesday Hours" = _t, #"Wednesday Hours" = _t, #"Thursday Hours" = _t, #"Friday Hours" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"EmployeeID", Int64.Type}, {"Monday Hours", Int64.Type}, {"Tuesday Hours", Int64.Type}, {"Wednesday Hours", Int64.Type}, {"Thursday Hours", Int64.Type}, {"Friday Hours", Int64.Type}})
in
    #"Changed Type"

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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