Help required with PQ

Alexis36

New Member
Joined
May 30, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm having trouble formating the data set attached into columns. I basically need one column for the week Number/Yearand the Quantity but I'm struggling to achieve that with Power Query.

Could someone guide me on how to do it please ?

1700665903472.png
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
can you share a screenshot of how you want the final result to look? Just manually create it
 
Upvote 0
@Alexis36 ,
Please upload a sample of the raw data using the XL2BB add-on.
Data from a picture are not helping.
 
Upvote 0
Column11column12column13column14column15column16column17column18column19column20column21column22column23
48/2023w02/2024w03/2024w04/2024w05/2024w06/2024w07/2024
128432432432432336336
(4)(4)(4)(4)(4)(4)(4)
0150
11/2024w12/2024w13/2024w14/2024w15/2024w16/2024w17/2024
432576595595595595624
(4)(4)(4)(4)(4)(4)(4)
22/2024w27/2024w31/2024w35/2024
1534836836432
(4)(4)(4)(4)

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Cols_as_txt = Table.TransformColumnTypes(Source,{{"Column11", type any}, {"column12", type text}, {"column13", type any}, {"column14", type text}, {"column15", type any}, {"column16", type text}, {"column17", type any}, {"column18", type text}, {"column19", type any}, {"column20", type text}, {"column21", type any}, {"column22", type text}, {"column23", type any}}),
    Filter_col13_no_nulls_no4 = Table.SelectRows(Cols_as_txt, each ([column13] <> null and [column13] <> "(4)")),
    Select_alternate_cols = List.Alternate(Table.ToColumns(Filter_col13_no_nulls_no4),1,1,1),
    Transform_to_table = Table.FromRows(List.Split(List.Combine(Select_alternate_cols),2)),
    Rename = Table.RenameColumns(Transform_to_table,{{"Column1", "Week"}, {"Column2", "Value"}}),
    Filter_no_null = Table.SelectRows(Rename, each ([Week] <> null))
in
    Filter_no_null
WeekValue
48/2023128
11/2024432
22/20241534
02/2024432
12/2024576
27/2024836
03/2024432
13/2024595
31/2024836
04/2024432
14/2024595
35/2024432
05/2024432
15/2024595
06/2024336
16/2024595
07/2024336
17/2024624
 
Upvote 0

Forum statistics

Threads
1,224,937
Messages
6,181,865
Members
453,068
Latest member
DCD1872

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