![]() ![]() If you do this process often, then it worth to create a custom function for it. I have written about that function in my other article here. If your data is coming from SharePoint or OneDrive, then you can use the equivalent of this function there, which is SharePoint.Contents instead of SharePoint.Files. Here you go, now you got the list of all tables: So all you need to do is to filter the Director column to be TRUE only The Directory column will return true or false as a result But the fact is that there are files even without extension! one easy way is to use the Attributes column and expand it to get the Directory column of that. You might say, files have an extension (the screenshot above. If you are only looking for folders, then you have to filter out files from the result set. not just folders, but also files.Īs you can see, this gives you the list of both files and folders, but only in the root of that folder (no subfolders searched). You can change that function to Folder.Contents, which will get a list of all items only in the root folder. This function get a list of all files across all subfolders. When you get data from Folder, it uses Folder.Files Power Query function. so let’s see another proper way of doing it. and if there is a folder without a file in it, then I would miss that folder. then remove the folder path prefix of that. So how can I do that? One way is to use the Get Data from Folder, but then use the Folder Path column, and get distinct of that. There are files under each folder, but I don’t want them. for example, I tend to create a folder for every one of my presentation engagements, and the folder looks like this:Īs you can see, the folder name is an important piece of information in my scenario. Sometimes just the folder contains some useful information. Which is a good option for combining files afterward, especially if they have a similar structure. The get data from a folder will give you the list of all files in that folder, and even subfolders that means it will extract all files in that folder. In Power BI, or let’s say Power Query part of the Power BI, you can get data from a folder. ![]() There is a little trick that can help you to get a list of folders. The Get Data From Folder option in Power BI will just give you a list of files. However, sometimes, even the folder name might contain some useful information. Of course folder itself (without considering files in it), doesn’t contain data to be used for a report. There are times that you need to get the list of FOLDERS and not just files. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |