SOLVED

Power query for multiple columns (and multiple dates)

Copper Contributor

Hi,

I am hoping to use power query to rearrange large plant sampling datasets, and part of this is transforming six columns into three. Datasets come from two sampling phases, so I have two dates, which correspond to two covers, and two heights.

 

I am trying to get one date column, one cover column, and one height column (so cover1 and height1 are in a row with date1, and cover2 and height2 are in the row with date2).

 

I finding it difficult to work out how to get the unpivot feature to still allow the cover and height to correspond to the correct date. (Note that if there is no cover, the date can be removed as the plant did not exist if there was no cover for it).

 

Thanks in advance!

Emily

 

PS. Running Windows 10 and Office 365.

2 Replies
best response confirmed by EmilyEB (Copper Contributor)
Solution

@EmilyEB 

If I understood the logic correctly, you may reference main query selecting related to date1 and date2 data and combine them together. Please see attached.

Thank you @Sergei Baklan, this is exactly what I was after!

I am new to power query so it took me a little while to work out how to replicate what you did, but making the two tables of the required information and then combining them should do what I need it to. My next step is to try it within an actual dataset. Thanks again!

1 best response

Accepted Solutions
best response confirmed by EmilyEB (Copper Contributor)
Solution

@EmilyEB 

If I understood the logic correctly, you may reference main query selecting related to date1 and date2 data and combine them together. Please see attached.

View solution in original post