Transform file that has dates as individual columns

seerauber

New Member
Joined
Aug 7, 2015
Messages
9
Hi all,

I'm not sure how to phrase this question clearly, so apologies in advance if this is confusing.

I am receiving a 'flat file' of sorts from a vendor that provides me with data on search engine keyword rankings by different products. I would like to load all of this data into my PowerBi model, however the file comes with a new column for each date, with the search ranking values for each product+keyword combination populated in the daily column cells. I'll post a short example of what I mean below. I suspect this transformation can be made in Power Query, but I've not been able to turn up any guides or articles to get me started.

Currently this file has ~10k rows, I haven't done the math but after the transformation that number will be significantly bigger, into the 1m+ range...

Any help or references that anyone can share would be very much appreciated! Please let me know if I can clarify the situation any further. Thank you!


How the file actually comes:

ProductMarketplaceKeywordEstimated Search Volume03/01/202103/02/202103/03/2021
SKU 1USKeyword 1
#​
35​
Over page 5
34​
SKU 2USKeyword 1
#​
Over page 5Over page 5Over page 5
SKU 3USKeyword 1
#​
14​
13​
12​
SKU 1USKeyword 2
#​
75​
88​
70​
SKU 2USKeyword 2
#​
Over page 5
8​
7​
SKU 3USKeyword 2
#​
14​
14​
14​

How I believe the file needs to be structured:
ProductMarketplaceKeywordEstimated Search VolumeSearch PositionDate
SKU 1USKeyword 1#
35​
3/1/2021​
SKU 1USKeyword 2#
75​
3/1/2021​
SKU 2USKeyword 1#Over page 5
3/1/2021​
SKU 2USKeyword 2#Over page 5
3/1/2021​
SKU 3USKeyword 1#
14​
3/1/2021​
SKU 3USKeyword 2#
14​
3/1/2021​
SKU 1USKeyword 1#Over page 5
3/2/2021​
SKU 1USKeyword 2#
75​
3/2/2021​
SKU 2USKeyword 1#Over page 5
3/2/2021​
SKU 2USKeyword 2#
8​
3/2/2021​
SKU 3USKeyword 1#
13​
3/2/2021​
SKU 3USKeyword 2#
14​
3/2/2021​
SKU 1USKeyword 1#
34​
3/3/2021​
SKU 1USKeyword 2#
70​
3/3/2021​
SKU 2USKeyword 1#Over page 5
3/3/2021​
SKU 2USKeyword 2#
7​
3/3/2021​
SKU 3USKeyword 1#
12​
3/3/2021​
SKU 3USKeyword 2#
14​
3/3/2021​
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Like this?

New__Document (82).xlsx
ABCDEF
1ProductMarketplaceKeywordEstimated Search VolumeDateSearchPosition
2SKU 1USKeyword 1#3/1/202135
3SKU 1USKeyword 2#3/1/202175
4SKU 2USKeyword 1#3/1/2021Over page 5
5SKU 2USKeyword 2#3/1/2021Over page 5
6SKU 3USKeyword 1#3/1/202114
7SKU 3USKeyword 2#3/1/202114
8SKU 1USKeyword 2#3/2/202188
9SKU 1USKeyword 1#3/2/2021Over page 5
10SKU 2USKeyword 2#3/2/20218
11SKU 2USKeyword 1#3/2/2021Over page 5
12SKU 3USKeyword 1#3/2/202113
13SKU 3USKeyword 2#3/2/202114
14SKU 1USKeyword 1#3/3/202134
15SKU 1USKeyword 2#3/3/202170
16SKU 2USKeyword 2#3/3/20217
17SKU 2USKeyword 1#3/3/2021Over page 5
18SKU 3USKeyword 1#3/3/202112
19SKU 3USKeyword 2#3/3/202114
Table3 (2)


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Unpivot = Table.UnpivotOtherColumns(Source, {"Product", "Marketplace", "Keyword", "Estimated Search Volume"}, "Date", "SearchPosition"),
    Sort = Table.Sort(Unpivot,{{"Date", Order.Ascending}, {"Product", Order.Ascending}, {"SearchPosition", Order.Ascending}})
in
    Sort
 
Upvote 0

Forum statistics

Threads
1,223,984
Messages
6,175,786
Members
452,670
Latest member
nogarth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top