cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abhilash_patel
Frequent Visitor

upload only last added file form sharepoint folder to power bi

Hi Everone,
I am connecting my power bi to sharepoint folder which has following file names 

2021_04_12 CIO Tasks Calendar - Week 39- V2.0
2021_04_11 CIO Tasks Calendar - Week 39- V2.0

2021_04_10 CIO Tasks Calendar - Week 39- V2.0

i want to upload the last added file to power bi in above file names the last added file is 2021_04_12 CIO Tasks Calendar - Week 39- V2.0.

 

 

 

As i understood correctly if i make any chages in files in share point then Date modified & Date created chages so can't consider those columns

2 ACCEPTED SOLUTIONS
AllisonKennedy
Super User III
Super User III

@abhilash_patel  the Date Created should not change - only the Date modified. 

 

Are these the only files in the folder? You can split the filename by delimiter and sort by date and then keep top 1 row. 

 

Let me know if you want more detail on how to do this in Power Query, but based on your comment about not being able to use date modified column I'm assuming a lot about what you already know. 🙂 And we all know it's a bad idea to make assumptions, so let us know how you get on. 🙂 



Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos. ?


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

@abhilash_patel  Only the modified date will change, created date will always be the date you first created the file with that name.



Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos. ?


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User III
Super User III

@abhilash_patel  the Date Created should not change - only the Date modified. 

 

Are these the only files in the folder? You can split the filename by delimiter and sort by date and then keep top 1 row. 

 

Let me know if you want more detail on how to do this in Power Query, but based on your comment about not being able to use date modified column I'm assuming a lot about what you already know. 🙂 And we all know it's a bad idea to make assumptions, so let us know how you get on. 🙂 



Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos. ?


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

@AllisonKennedy  Thanks for the solution  currently i am doing the similar way but adding the index column and filtering the index column. 
Just want to know any other options  

@abhilash_patel Just be careful using the Index column as you can't guarantee the sort order of the files in SharePoint. When you pull data from SharePoint there's access to lots of columns with 'record' and 'table' data in them - there might be a handy column in there that gives the date you're looking for. I'm still not sure why we can't use the [Created] date?



Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos. ?


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

Hi @AllisonKennedy  yeah your ryt ther is issue with using index so i have split the file name 
2021_04_12 CIO Tasks Calendar - Week 39- V2.0 (example) extracting the date and sorting it and keepting the first row only.

The problem with created date is suppose if i upload the file to share point yesterday (19-April-2021) then created and modified date will be (19-April-2021) but if

i accedentaly open the file today (20-April-2021) in the sharepoint then created and modified date chages to (20-April-2021).
which meand created or modified date is not stable is if we open the file in sharepoint then it changed to that particular date 

@abhilash_patel  Only the modified date will change, created date will always be the date you first created the file with that name.



Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos. ?


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


www.excelwithallison.com

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors