Power Query - Filling down a Block of Data

scpournara

New Member
Joined
Aug 24, 2014
Messages
45
I have a data set and I am trying to create a new column where I can repeat the MFG column for each Name. If I simply Fill Don in Column "MFG" it get CRC fro all the records. I want to build a Column where to get thRow 1 thru 16 to repeat all the way down. Thanks.


PQ fill down.JPG
 

Attachments

  • PQ fill down.JPG
    PQ fill down.JPG
    94.4 KB · Views: 15

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If you have Names in Table1 and MFG in Table2 like this:

Book1
ABCD
1
2NameMFG
3Name1Southwire
4Name2Southwire TCAS (Tools, Components & Assembled Solutions)
5Name3Heritage
6Name4Crouse Hinds
7Power Quaity
8Bussmann
9Wiring Device
10lisco
11Hammond
12HellermannTyton
13Harger
14RAB
15FLO
16CRC
17
18
Sheet2


the following query:

Power Query:
let
    NamesTable = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    MFGTable = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    AddMFG = Table.AddColumn(NamesTable, "MFGCustom", each MFGTable),
    ExpandMFG = Table.ExpandTableColumn(AddMFG, "MFGCustom", {"MFG"}, {"MFG"})
in
    ExpandMFG

Produces this:

Book1
AB
1NameMFG
2Name1Southwire
3Name1Southwire TCAS (Tools, Components & Assembled Solutions)
4Name1Heritage
5Name1Crouse Hinds
6Name1Power Quaity
7Name1Bussmann
8Name1Wiring Device
9Name1lisco
10Name1Hammond
11Name1HellermannTyton
12Name1Harger
13Name1RAB
14Name1FLO
15Name1CRC
16Name2Southwire
17Name2Southwire TCAS (Tools, Components & Assembled Solutions)
18Name2Heritage
19Name2Crouse Hinds
20Name2Power Quaity
21Name2Bussmann
22Name2Wiring Device
23Name2lisco
24Name2Hammond
25Name2HellermannTyton
26Name2Harger
27Name2RAB
28Name2FLO
29Name2CRC
30Name3Southwire
31Name3Southwire TCAS (Tools, Components & Assembled Solutions)
32Name3Heritage
33Name3Crouse Hinds
34Name3Power Quaity
35Name3Bussmann
36Name3Wiring Device
37Name3lisco
38Name3Hammond
39Name3HellermannTyton
40Name3Harger
41Name3RAB
42Name3FLO
43Name3CRC
44Name4Southwire
45Name4Southwire TCAS (Tools, Components & Assembled Solutions)
46Name4Heritage
47Name4Crouse Hinds
48Name4Power Quaity
49Name4Bussmann
50Name4Wiring Device
51Name4lisco
52Name4Hammond
53Name4HellermannTyton
54Name4Harger
55Name4RAB
56Name4FLO
57Name4CRC
58
59
Merge
 
Upvote 0
ExpandMFG
Thanks. I did create a Table for the Names and a Table for the MFG. I copied your formula and tried to insert it through the Advance Editor on the Power Query. Below is the current code. How do I insert to get the results. Thanks for you help.

let
Source = Folder.Files("G:\Shared drives\30-ElectroRep Management\Human Resources\Time Allocation\fdata"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Estimated % of Time Last 12 Months", Percentage.Type}, {"Anticipated % of Time Next 12 Months", Percentage.Type}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Column5", "Column6", "Column7"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Name] <> null)),
#"Renamed Columns" = Table.RenameColumns(#"Filtered Rows",{{"Erica Ball", "MFG"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"MFG", type text}})
in
#"Changed Type1"
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,050
Members
452,542
Latest member
Bricklin

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