Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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 😁
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
13 | |
11 | |
8 | |
8 |
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
7 |