Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi Community,
I use data in a Sharepoint folder, where 3 news files are automatically stored every days.
I want to sort them, to keep the 3 earliest files (sorted by column modified).
For the current month, I know how to do it, but how can I sort these files for every months ?
Meaning, I need the 3 last files for January, for December and so on ... ?
Thank you
Regards
Solved! Go to Solution.
Essaye cela dans ton code,
let
Source = Ta Source SharePoint,
AddYear = Table.AddColumn(Source, "Year", each Date.Year([Date modified]), type number),
AddYearMonth = Table.AddColumn(AddYear, "Month", each Date.Month([Date modified]), type number),
SortedFiles = Table.Sort(AddYearMonth, {{"Date modified", Order.Descending}}),
GroupedFiles = Table.Group(SortedFiles, {"Year", "Month"}, {
{"AllData", each _, type table}}),
AddIndexAndFilter = Table.TransformColumns(GroupedFiles, {
"AllData", each Table.FirstN(Table.AddIndexColumn(_, "Index", 1, 1, Int64.Type), 3)
})
in
AddIndexAndFilter
Ensuite tu developpes la colonne Data et tu gardes les colonnes que tu veux
Essaye cela dans ton code,
let
Source = Ta Source SharePoint,
AddYear = Table.AddColumn(Source, "Year", each Date.Year([Date modified]), type number),
AddYearMonth = Table.AddColumn(AddYear, "Month", each Date.Month([Date modified]), type number),
SortedFiles = Table.Sort(AddYearMonth, {{"Date modified", Order.Descending}}),
GroupedFiles = Table.Group(SortedFiles, {"Year", "Month"}, {
{"AllData", each _, type table}}),
AddIndexAndFilter = Table.TransformColumns(GroupedFiles, {
"AllData", each Table.FirstN(Table.AddIndexColumn(_, "Index", 1, 1, Int64.Type), 3)
})
in
AddIndexAndFilter
Ensuite tu developpes la colonne Data et tu gardes les colonnes que tu veux
Merci beaucoup, c'est parfait 😁
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
12 | |
11 | |
11 | |
8 |
User | Count |
---|---|
43 | |
25 | |
16 | |
15 | |
12 |