Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Stuck on Transforming Data via Pivot in PowerQuery Editor

Hi Folks,

 

I'm in a pickle. I am trying to get my data set in Power BI in Power Query editor to go from this below:

 

Employee IDWorkerLocation Address - CountryWorker TypeTime Off Balance 
123456Scooby DooUSAEmployeePTO10
123456Scooby DooUSAEmployeeSick2
123456Scooby DooUSAEmployeeMedical5
123456Scooby DooUSAEmployeeHoliday0
123456Scooby DooUSAEmployeeJury8
123456Scooby DooUSAEmployeeMarriage0

 

To this right here -- I want to take the time off plan and switch them to one row with the balances like this:

 

Employee IDWorkerLocation Address - CountryWorker TypePTOSickMedicalHolidayJuryMarriage
123456Scooby DooUSAEmployee1025080

 

I've been trying to do this for the last hour and I can't seem to find a good example on how to do this. Any help would be much appreciated please! Thanks everyone! 

 

Best,

AJ

  • Select the TimeOff column and choose 'Pivot' from the Transform menu.  Use Balance as the values.

5 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Select the TimeOff column and choose 'Pivot' from the Transform menu.  Use Balance as the values.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I did that. While it gives me the columns, it puts the balance on different rows instead of on the same row. 😞

      • Anonymous's avatar
        Anonymous
        Not applicable

        It gives me an output like this:

         

        Employee IDWorkerLocation Address - CountryWorker TypePTOSickMedicalHolidayJuryMarriage
        123456Scooby DooUSAEmployee10     
        123456Scooby DooUSAEmployee 2    
        123456Scooby DooUSAEmployee  5   
        123456Scooby DooUSAEmployee   0  
        123456Scooby DooUSAEmployee    8 
        123456Scooby DooUSAEmployee     0