Forum Discussion
Slicer to select specific SharePoint Folder
- 6 years ago
Anonymous the technique should be load all the reports and tag each report with a respective period which will be then used to slicer the data. There are many topics on how to load data from share point folders and append together.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Hi Anonymous ,
If you want to use slicer to achieve this goal, you need to make sure all columns in each month folder have same name and type. Then you could try to below code to achieve this goal
let
Source = SharePoint.Files("https://<company>.sharepoint.com/teams/fortest2", [ApiVersion = 15]),
#"Inserted Text Between Delimiters" = Table.AddColumn(Source, "Text Between Delimiters", each Text.BetweenDelimiters([Folder Path], "/", "/", {1, RelativePosition.FromEnd}, 0), type text),
#"Filtered Rows" = Table.SelectRows(#"Inserted Text Between Delimiters", each ([Extension] = ".xlsx") and ([Text Between Delimiters] = "Feb" or [Text Between Delimiters] = "Jan")),
#"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows", each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File (2)", each #"Transform File (2)"([Content])),
#"Removed Other Columns1" = Table.SelectColumns(#"Invoke Custom Function1",{"Text Between Delimiters", "Transform File (2)"}),
#"Expanded Transform File (2)" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File (2)", {"year", "max", "date"}, {"year", "max", "date"})
in
#"Expanded Transform File (2)"
when you click expand [content], it will automatically generate #Invoke Custom Function1 step, then you could choose [Transform File] and month column to expand, and use this month column in slicer, then you will achieve your goal.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.