Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have spent a lot of time sorting out the data source (Folder) and making sure it doesnt add helper files because I want to go to the folder and select multiple files with the same structure
then bring them through with the file name
This is the start of the code
let
Source = Folder.Files("C:\Users\MyName\Company\Project\Dummy Data"),
#"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Name], "Project")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Content", "Name"}),
However, its the local folder and not the Sharepoint folder.
What I really want to do it change it to the Sharepoint folder structure as easily as possible
I had a look at another forum post but this was connecting to the actual file not just the folder. I tried this
Source = Folder.Files("https://Company.sharepoint.com/sites/Project/Shared Documents/General/Dummy Data/"),
But get the error The supplied folder path must be a valid absolute path.
Is there an easy way I can move this from the Local folder to the Sharepoint folder and then continue with all the other M code Steps I have to
Filter to the files required
bring through the data (without creating Helper Queries including the file name
Solved! Go to Solution.
I have sorted it
Source = SharePoint.Files("https://Company.sharepoint.com/sites/Project/", [ApiVersion = 15]),
//Filter to the correct folder
#"Filtered Rows2" = Table.SelectRows(Source, each Text.Contains([Folder Path], "Dummy Data")),
//Filter to the correct files
#"Filtered Rows" = Table.SelectRows(#"Filtered Rows2", each Text.Contains([Name], "Project")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Content", "Name"}),
and then you can continue on with the code
I have sorted it
Source = SharePoint.Files("https://Company.sharepoint.com/sites/Project/", [ApiVersion = 15]),
//Filter to the correct folder
#"Filtered Rows2" = Table.SelectRows(Source, each Text.Contains([Folder Path], "Dummy Data")),
//Filter to the correct files
#"Filtered Rows" = Table.SelectRows(#"Filtered Rows2", each Text.Contains([Name], "Project")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"Content", "Name"}),
and then you can continue on with the code
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |