Forum Discussion

RPAI2812's avatar
RPAI2812
Helper I
4 years ago
Solved

Reorganizing data

Hi, I wanted some help to rearrange my table in Power Query 🙂
Currently, I have one column for each initial and end date for three different trips. 

 

PersonStart Trip 1End Trip 1Start Trip 2End Trip 2Start Trip 3End Trip 3
Peter01/01/202207/01/202228/01/202204/02/202216/02/202223/02/2022
Maria01/01/202207/01/202228/01/202204/02/202216/02/202223/02/2022
John06/01/202217/01/202218/02/202224/02/202208/03/202213/03/2022

 

I wanted to unpivot that so the table would like the one below. I have a column with the trip number and the start and end date from each trip.

 

PersonTripStart DateEnd Date
Peter101/01/202207/01/2022
Peter228/01/202204/02/2022
Peter316/02/202223/02/2022
Maria101/01/202207/01/2022
Maria228/01/202204/02/2022
Maria316/02/202223/02/2022
John106/01/202217/01/2022
John218/02/202224/02/2022
John308/03/202213/03/2022
  • Yes it's an Unpivot (all date columns).

    Split the resulting column (by Space as far right as possible)-> that gets the numbers into a column.

    Then Pivot the 'Start Trip'/End Trip' Column with Don't Aggregate

1 Reply

  • HotChilli's avatar
    HotChilli
    Community Champion

    Yes it's an Unpivot (all date columns).

    Split the resulting column (by Space as far right as possible)-> that gets the numbers into a column.

    Then Pivot the 'Start Trip'/End Trip' Column with Don't Aggregate