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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

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

View solution in original post

5 REPLIES 5
HotChilli
Super User
Super User

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

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. 😞

Post the advanced editor code and i'll have a look.

Are you using the sample data or your real data?

Anonymous
Not applicable

Actually, it worked. There was another column that I didn't include that kept it from truncating.

Thank you -- this worked! Much appreciated!

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.