PowerQuery Transform question

deLockloire

Board Regular
Joined
Apr 4, 2008
Messages
110
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm importing an .xml containing exchange rates from the ECB website. The result of that import is a data structure like this:

DATE
Exchange Rate
Currency
Date1Currency1 Exchange Rate 1Currency1
Date2Currency1 Exchange Rate 2Currency1
Date3Currency1 Exchange Rate 3Currency1
Date1Currency2 Exchange Rate 1Currency2
Date2Currency2 Exchange Rate 2Currency2
Date3Currency2 Exchange Rate 3Currency2
Date1Currency3 Exchange Rate 1Currency3
Date2Currency3 Exchange Rate 2Currency3
Date3Currency3 Exchange Rate 3Currency3


However, I'd like to transform this during the import so that each currency gets their own column. Like this:

DATE
CURRENCY1
CURRENCY2
CURRENCY3
Date1Currency1 Exchange Rate 1Currency2 Exchange Rate 1Currency3 Exchange Rate 1
Date2Currency1 Exchange Rate 2Currency2 Exchange Rate 2Currency3 Exchange Rate 2
Date3Currency1 Exchange Rate 3Currency2 Exchange Rate 3Currency3 Exchange Rate 3


Unfortunately, not every currency has values for every date. So it might be the case that for Currency1, the whole Date1 row is missing. In such cases, I'm okay if the exchange rate is left blank or filled with the last value if there is one before that. Can this be done in one fell swoop in Power Query?

Thanks for any input!

deL
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Load into powerquery, highlight the currency column, and then go to transform=>Pivot Column
Values Column = Exchange Rate
Advanced Options=> Aggregate Value Function = Don't Aggregate
 
Upvote 0
Solution

Forum statistics

Threads
1,215,235
Messages
6,123,779
Members
449,123
Latest member
StorageQueen24

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