Forum

Transpose / pivot d...
 
Notifications
Clear all

Transpose / pivot data in power Query

11 Posts
3 Users
0 Reactions
151 Views
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

Dear Forum

 

i have three columns.

one column contains the invoice number

one column contains the description of the booking (always 5)

One column contains the Value

Instead of this descriptions on a horizontal row, I want them as a column.
How can I Transpose this?

See attachementDataset.png

 

The blue one is the goal , how my other set is to harmonize the data.Goal.png

 
Posted : 10/02/2022 6:35 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Kevin,

Welcome to our forum!

You need to pivot the description column. If you attach a sample file it's easier for us to help you. If you get stuck, please share a file.

Mynda

 
Posted : 10/02/2022 8:14 am
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

Dear Mynda,

thanks for the welcome and the reply,

 

I tried to pivot it, but then the values will not go in the right column.

As the screenshot shown, in the row each line has its value.

But now it brings the value to one row, instead of in the related column.pivot_values.png

 
Posted : 11/02/2022 7:06 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Kevin,

Please provide a sample Excel file. It looks like you didn't choose the correct column for the values.

Mynda

 
Posted : 11/02/2022 7:19 pm
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

I thought i submitted the file, but apparently it wasn't uploaded properly,

 

here I try it again; 

 
Posted : 15/02/2022 8:17 am
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

oh by the way, i now see its you, Mynda !

absolutely love your videos! i learned so much from you!

 
Posted : 15/02/2022 8:19 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Kevin,

Great to hear you found my videos helpful

Thanks for sharing your file. If you look at the value in the Rekeningnr column you'll see that it's different for each description. Similarly for some of the rows in the Rekening column. If theses values were the same on each row, then the data would Pivot more in line with the way you're expecting. 

If you take a smaller sample of your data, say rows 2 - 16, and pivot that you'll see the issue more clearly. Alternatively, if you insert a PivotTable and try to pivot the Description field in the column labels, as you add fields to the row labels you'll see the issue is evident once you get to the Rekeningnr column, and then continues to get worse as you add fields to the row labels. This is the same thing that happens in Power Query when you pivot the Description column.

I hope that helps you understand the issue. Hopefully you can decide which columns you can eliminate to achieve the pivoted result you're after as that's not something I can decide for you.

Mynda

 
Posted : 15/02/2022 9:35 pm
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

Hi Myanda,

the 'rekeningnr' doenst need to be in there,

i only would need the | Groente | Overig | BTW  actually,

If there is a way to eliminate this, probably by filtering the data first by ; ' doesn't contain value' and then pivot whats left?

 
Posted : 19/02/2022 8:17 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Kevin,

If you remove the Rekeningnr column and rows containing fust, fruit and totaal inc btw, before pivoting then the issue is resolved. Try it and you will see.

Mynda

 
Posted : 19/02/2022 9:34 pm
(@kevinl96)
Posts: 14
Eminent Member
Topic starter
 

unfortunately i didn't figure it out yet,

Because i need the rows with Fust, groente etc, those are the row value,

this is a picture of what I need to achieve, Goal-1.png

To have the overview by customer with the related values..

 
Posted : 02/03/2022 3:23 am
(@debaser)
Posts: 836
Member Moderator
 

Can you not just remove everything apart from the last 3 columns, then pivot on description as Mynda suggested before? That appears to do what you want.

 
Posted : 02/03/2022 6:53 am
Share: