Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello
How can I pick the latest file from a list of sharepoint files in a folder using Power Query?
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
The power query code is like this:
let
Source = SharePoint.Files("https://xxx.sharepoint.com/sites/xxx", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, let latest = List.Max(Source[Date modified]) in each [Date modified] = latest)
in
#"Filtered Rows"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can follow these steps to get the lastest file from Sharepoint folder:
1. Connect to Sharepoint folder, choose transfrom data
2. In power query, select the date modified column and filter it as 'Is latest'
3. Now you will get the lastest file content in power query, expand and import it into power bi to get the whole data.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
The power query code is like this:
let
Source = SharePoint.Files("https://xxx.sharepoint.com/sites/xxx", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, let latest = List.Max(Source[Date modified]) in each [Date modified] = latest)
in
#"Filtered Rows"
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can do this with a relative reference instead of an absolute one to a specific file. Please see this video and subscribe to that channel if you find it useful.
https://www.youtube.com/watch?v=nscUeOL5m90
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.