Forum Discussion

souhail98's avatar
souhail98
Frequent Visitor
5 years ago
Solved

row data as column

Hi, 

 

For a transport analysis i want to know the all the activities/stops from the whole ride. 

Every ride has an unique ride header number and all the activities have also unique activity number. 

The activities are vertical stored in the table, i want them horinzontally to show and measure the time diffrence between them. 

Can some one help me with this? 

 

Thanks in advance. 

  • Hi souhail98 ,

     

    Please refer to my .pbix file.

    Note: The first thing you need to do is to pivot the table(refer to the step in Power Query).

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 Replies

  • souhail98 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
    Appreciate your Kudos.

    • souhail98's avatar
      souhail98
      Frequent Visitor

      Hi Amit, 

      Thanks for your reply. 

      The table below is my datasource, every row is an activity within the Transport ride. 

      Ride header activity id activity name Timezip code, etc
      313790180978start06:004844
      313790180979Load06:154844
      313790180980unload13:155001
      313790180981end 17:004844

      I want to make a table visual with calcultated (duration) columns, something like this below: 

      Ride headerStartloadDuration load timeZipcode unload

      Duration 

      Drive and unload time 

      Zipcodeend Duration drive back time Total time 
      31379006:0006:1515 min484413:157 hours500117:003:4511 hours

       

      I hope it is understandable. i dont know how to convert the vertical data to horizontal in a

      chronological flow (start, load, unload, end ). 

       

      Thanks in advance.

      • v-lionel-msft's avatar
        v-lionel-msft
        Community Support

        Hi souhail98 ,

         

        Please refer to my .pbix file.

        Note: The first thing you need to do is to pivot the table(refer to the step in Power Query).

         

        Best regards,
        Lionel Chen

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • souhail98's avatar
    souhail98
    Frequent Visitor

    Hi Amit, 

    Thanks for your reply. 

    The table below is my datasource, every row is an activity within the Transport ride. 

    Ride header activity id activity name Timezip code, etc
    313790180978start06:004844
    313790180979Load06:154844
    313790180980unload13:155001
    313790180981end 17:004844

    I want to make a table visual with calcultated (duration) columns, something like this below: 

    Ride headerStartloadDuration load timeZipcode unload

    Duration 

    Drive and unload time 

    Zipcodeend Duration drive back time Total time 
    31379006:0006:1515 min484413:157 hours500117:003:4511 hours

     

    I hope it is understandable. i dont know how to convert the vertical data to horizontal in a

    chronological flow (start, load, unload, end ). 

     

    Thanks in advance.