Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Power query

Good afternoon with everyone I need a help in the query editor of power BI, I am making a connection to a sharepoint folder in which you have several excels with versions I just need to stay with the latest versions in this case the last _rev of each type of excel, some suggestion.

attached image

versiones.JPG

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

If you want to filter the latest version for per date group, you can try the following steps.

 

1. Add a custom column to get date values.

 

= Text.Start(Text.Select([Name], {"0".."9"}),4)

vkkfmsft_0-1633660764706.png

 

2. Filter the rows that contain "_rev" and do not start with "~$" in the Name column.

 

vkkfmsft_1-1633660916841.png              

 

3. Sort the Name column in descending order.

 

vkkfmsft_2-1633660951129.png

 

4. Group based on column DateGroup.

 

vkkfmsft_3-1633660975690.png


5. Create custom column for adding index to the groups.

= Table.AddIndexColumn([All],"Index",1)

vkkfmsft_4-1633661005921.png

 

6. Remove all columns except column Data, then extend column Data.

vkkfmsft_5-1633661050107.png

vkkfmsft_6-1633661084186.png

7. Filter rows with [Index] = 1.

 

vkkfmsft_7-1633661115649.png

8. You will get:

 

vkkfmsft_8-1633662017330.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

If you want to filter the latest version for per date group, you can try the following steps.

 

1. Add a custom column to get date values.

 

= Text.Start(Text.Select([Name], {"0".."9"}),4)

vkkfmsft_0-1633660764706.png

 

2. Filter the rows that contain "_rev" and do not start with "~$" in the Name column.

 

vkkfmsft_1-1633660916841.png              

 

3. Sort the Name column in descending order.

 

vkkfmsft_2-1633660951129.png

 

4. Group based on column DateGroup.

 

vkkfmsft_3-1633660975690.png


5. Create custom column for adding index to the groups.

= Table.AddIndexColumn([All],"Index",1)

vkkfmsft_4-1633661005921.png

 

6. Remove all columns except column Data, then extend column Data.

vkkfmsft_5-1633661050107.png

vkkfmsft_6-1633661084186.png

7. Filter rows with [Index] = 1.

 

vkkfmsft_7-1633661115649.png

8. You will get:

 

vkkfmsft_8-1633662017330.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

amitchandak
Super User
Super User

@Syndicate_Admin , refer if this blog can help

 

https://medium.com/@wkrzywiec/getting-data-from-the-latest-file-in-a-folder-using-power-query-51dfa4...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.