Forum Discussion

hnsbhat's avatar
hnsbhat
Helper I
8 years ago
Solved

Help needed for Data Transformation in Powerquery

Hi, I have a data table with Names, start date of the week, end date of the week and hours for each week day in columns. I need to transpose this table to get date-wise hours for each name. Itries unpivot columns, but it gives same headings for each date in rows, I am not able to figure out how to get dates in between the week starts and week ending.

 

Below are the input table and expected output. Is there a way to do this in Powerquery? Thanks for your help.

 

Input

 

NameStart DateEnd DateMonday HoursTuesday HoursWednesday HoursThursday HoursFriday HoursSaturday HoursSunday Hours

ABC5/2/201811/2/20188888000
ABC12/2/201818/2/20188888800
XYZ5/2/201811/2/20188444400
XYZ12/2/201818/2/20180008800

 

Expected Output - 

 

NameDateHours
ABC5/2/20188
ABC6/2/20188
ABC7/2/20188
ABC8/2/20188
ABC9/2/20180
ABC10/2/20180
ABC11/2/20180
ABC12/2/20188
ABC13/2/20188
ABC14/2/20188
ABC15/2/20188
ABC16/2/20188
ABC17/2/20180
ABC18/2/20180
XYZ5/2/20188
XYZ6/2/20184
XYZ7/2/20184
XYZ8/2/20184
XYZ9/2/20184
XYZ10/2/20180
XYZ11/2/20180
XYZ12/2/20180
XYZ13/2/20180
XYZ14/2/20180
XYZ15/2/20188
XYZ16/2/20188
XYZ17/2/20180
XYZ18/2/20180

 

2 Replies