Power BI文件夹源:获取各子文件夹最新更新文件的方法求助
Power Query: Retrieve Latest Modified File Per Folder (Preserving Binary & Attributes Columns)
I have a directory with subfolders named after months (May, Jun, July — I'll add August later) that store daily exported files. My goal is to:
- Get the most recently modified file from each subfolder
- Keep the
BinaryandAttributescolumns for these files - End up with 3 (soon to be more) CSV files ready to expand
What I've Tried & Issues Encountered
- I first grouped by
Folder Pathand took the maximumDate modifiedvalue, but this stripped out theBinaryandAttributescolumns I need. - I tried adding a max on
Attributesor keeping all rows in the group, but neither approach gave me the full row for the latest file. - When following a community solution approach, I hit this error:
Function type value cannot be converted to Table type. Details: Value = [Function], Type = [Type]
My Current M Query Code
let Source = AzureStorage.DataLake(".../usersDailyData"), #"Filtered Hidden Files1" = Table.SelectRows(#"Sorted Rows", each [Attributes]?[Hidden]? <> true), #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transformar archivo", each #"Transformar archivo"([Content])), #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {{"Name", "Source.Name"}}), #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transformar archivo"}), #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transformar archivo", Table.ColumnNames(#"Transformar archivo"(#"Archivo de ejemplo"))), #"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{ Columns name here }) in #"Changed Type"
Could someone share a clear approach to solve this? Thanks in advance!
内容的提问来源于stack exchange,提问作者DR17
相关产品推荐
相关产品推荐

