Power Query : Split Column Based On 'Folder & Files' Then Move Up The Same Row

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,091
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..

how to split column based on name "Folder" and "Files" ,
my expected start col C3 and D3 down
here this layout
Extract List Doc WBBM.xlsx
ABCD
1original datadesired result
2File's NameModelCol1 (folder)Col2 (files)
3ManajementFolderManajement
41. Working TeamFolder1. Working Team
51aFolder1aKep-11
6Kep-11FilesKep-123
7Kep-123Files
81bFolder1battendance
9attendanceFilesphotos1
10photos1Filesdocument1
11document1Filesdocument2
12document2Files
132. Long PlanningFolder2. Long Planning
145a ConsumentFolder5a Consument
155bFolder5b
165cFolder5c
175dFolder5d
185eFolder5e
Sheet1


anybody help out, thank in advance
susant
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You can try
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"File's Name", type text}, {"Model", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    #"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Model]), "Model", "File's Name"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index"})
in
    #"Removed Columns"

1668941042753.png
 
Upvote 0
You can try
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"File's Name", type text}, {"Model", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    #"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Model]), "Model", "File's Name"),
    #"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index"})
in
    #"Removed Columns"

View attachment 79099
hi GraH...thanks but not fully work, please see my attachment picture should be the result is the move up and the same line
 

Attachments

  • folder problem.png
    folder problem.png
    14.1 KB · Views: 31
Upvote 0

Forum statistics

Threads
1,223,992
Messages
6,175,823
Members
452,672
Latest member
missbanana

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