The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
We are conecting to a folder which has multiple files -- basically 3 different file formats. Is there a way when we connect to the folder -- maybe going into 'Advanced' where it shows it in M code -- and filtering by specific file names? i.e. We have file names "Positions", "Transactions" and "Returns" all in the same folder. Only want to view where file names begin with 'Position' or end with .xls -- like filtering positions* or *.xls.
Thanks!
Dan
Solved! Go to Solution.
@dancarr22,
Add a custom column in Query Editor using the following formula, then filter the custom column to "Yes".
if Text.Contains([Name], "Equity") then "Yes" else "No"
You can review the example below.
Regards,
@dancarr22,
Change the code in your Advance Editor to the following:
let Source = Folder.Files("YouPath\folder"), #"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".xls")) in #"Filtered Rows"
Then in Query Editor you are able to view only those files with .xls in Query Editor, there is an example for your reference.
Regards,
Thanks! This is great -- answer 90% of my question.
One follow-up then will close this: how would I filter by file name instead of file extension -- i.e. All files that begin with or contain '%Equity%'.
Thanks for your assistance with this -- greatly appreciated.
@dancarr22,
Add a custom column in Query Editor using the following formula, then filter the custom column to "Yes".
if Text.Contains([Name], "Equity") then "Yes" else "No"
You can review the example below.
Regards,
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.