March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello forum members,
Can someone explain me how te add a column with the folder names to my PowerBI table?
Thanx in advance,
Loek
Solved! Go to Solution.
Hi @loekvs ,
We can edit the steps after Rename column name as below. M code for your reference as well.
let Source = Folder.Files("D:\Case\New folder"), #"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"}), #"Filtered Hidden Files2" = Table.SelectRows(#"Renamed Columns1", each [Attributes]?[Hidden]? <> true), #"Invoke Custom Function2" = Table.AddColumn(#"Filtered Hidden Files2", "Transform File (2)", each #"Transform File (2)"([Content])), #"Expanded Transform File" = Table.ExpandTableColumn(#"Invoke Custom Function2", "Transform File", {"Date", "cat", "Sales"}, {"Transform File.Date", "Transform File.cat", "Transform File.Sales"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded Transform File",{"Folder Path", "Transform File.Date", "Transform File.cat", "Transform File.Sales"}) in #"Removed Other Columns"
Hi @loekvs ,
We can edit the steps after Rename column name as below. M code for your reference as well.
let Source = Folder.Files("D:\Case\New folder"), #"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"}), #"Filtered Hidden Files2" = Table.SelectRows(#"Renamed Columns1", each [Attributes]?[Hidden]? <> true), #"Invoke Custom Function2" = Table.AddColumn(#"Filtered Hidden Files2", "Transform File (2)", each #"Transform File (2)"([Content])), #"Expanded Transform File" = Table.ExpandTableColumn(#"Invoke Custom Function2", "Transform File", {"Date", "cat", "Sales"}, {"Transform File.Date", "Transform File.cat", "Transform File.Sales"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded Transform File",{"Folder Path", "Transform File.Date", "Transform File.cat", "Transform File.Sales"}) in #"Removed Other Columns"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
113 | |
77 | |
55 | |
54 | |
43 |
User | Count |
---|---|
183 | |
119 | |
77 | |
65 | |
56 |