Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi PowerQuery people,
Could You give me ANY hint where to find some reference for options?
Several functions have subject like parameter - for example Folder.Files
Only I find from docs or search is the fact that there is options or samples WITHOUT those options
But where to find FULL conent of those options
I suppose that Folder.Files is capable to traverse search all subfolders or generate list of subfolders but Only I can do is simply guess?
Any usefully reference is welcome
Henn
PS! Is theree any function (or any FUTURE function) to evaluate Environment or CURRENT PATH for file
Solved! Go to Solution.
You can get a little more info by using #shared as your source in a blank query. Convert that to a table and then filter to and click on the function of interest. In the case of Folder.Files(), the optional parameter is "PreserveLastAccessTimes" and accepts true or false.
Here is the query I used to get to this function, if you want to see for yourself.
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "Folder.Contents" or [Name] = "Folder.Files")),
Value = #"Filtered Rows"{1}[Value]
in
Value
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
SOmething I tried to create
Better to have some kind of option to allow include subdirs content
something like -Recurse in powershell Get-ChildItem have
(path as text) as table =>
let
Source = Folder.Contents(path),
// Source{[Name="Aiseesoft Studio"]}[Attributes][Directory]
Folders = Table.SelectRows(Source, each ([Attributes][Directory] = true)),
Step1 = Table.SelectColumns(Folders,{"Name", "Folder Path"}),
Step2 = Table.AddColumn(Step1, "DirContent", each DirContent([Folder Path]& [Name])),
Step3 = Table.RemoveColumns(Step2,{"Folder Path", "Name"}),
Expanded = Table.ExpandTableColumn(Step3, "DirContent", {"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}, {"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}),
Files = Table.SelectRows(Source, each ([Attributes][Directory] = false)),
Result = Table.Combine({Files,Expanded})
in
Result
Thänks - this #shared know (form past) - I forget that #shared show a bit more about options (no reference but some hint). As I understand - only option there is to preserve LastAccess untouched
NO option to traverse CONTENT of subfolders so for this I have to create some recursive function (is that possible with powerquery) to get content of folder appended contents from all subfolders
Hi @HennSarv
Thanks to mahoneypat's suggestion,
As for get folders and its sub folders, you could refer to the following:
https://radacad.com/get-the-list-of-folders-only-in-power-bi-using-power-query
Best regards
Maggie
You can get a little more info by using #shared as your source in a blank query. Convert that to a table and then filter to and click on the function of interest. In the case of Folder.Files(), the optional parameter is "PreserveLastAccessTimes" and accepts true or false.
Here is the query I used to get to this function, if you want to see for yourself.
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "Folder.Contents" or [Name] = "Folder.Files")),
Value = #"Filtered Rows"{1}[Value]
in
Value
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanksa lot for help
this #shared thing I never reached. Somewhere documented? Something more hidden : )
Henn
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
70 | |
56 | |
43 | |
28 | |
22 |