PowerQuery - Modify data

GeorgeTimes

New Member
Joined
Jul 22, 2022
Messages
16
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
Platform
  1. Windows
Hi all,

I have a raw data that stores invoices per month. Next month will add 2 more columns for invoice for that specific month (see below example of my raw data).

Column D and E - invoice for June 2021

Column F and G - invoice for July 2021

ONLY USE TO UPDATE PBI.xlsx
ABCDEFG
1CountryNovationDateRegionPI Value Jun-21App Value Jun-21PI Value Jul-21App Value Jul-21
2AlbaniaOut ofEM1742505.941771672.231771672.23
3Algeria01/03/2021EM1742505.94370.70426.06
Sheet1



I need to transform this in powerQuery in order to have something like below.

Any idea how I can do that? I need to have the same column names, but the raw data for those months to be displayed on new rows, not new columns

ONLY USE TO UPDATE PBI.xlsx
ABCDEF
15CountryNovationDateRegionPI ValueApp Valuedate
16AlbaniaOut ofEM1742505.94Jun-21
17Algeria01/03/2021EM1742505.94Jun-21
18AlbaniaOut ofEM1771672.231771672.23Jul-21
19Algeria01/03/2021EM370.70426.06Jul-21
Sheet1



Columns A B C will always stay the same.

Need this to be transformed in PowerQuery or by VBA, don't need it in PivotTable.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Select the first three columns, then right-click one and choose Unpivot other columns. That should give:
1663844923935.png

Now split the Attribute column by the last space delimiter:
1663844962812.png

Then pivot on Attribute.1 using Value as the Value field:
1663845000606.png

and rename columns as desired.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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