Forum Discussion
Anonymous
5 years agoNot applicable
List.Max filter on date degrading Power query performance
Hi All, I am using below step in query to limit data in my query. In below line am puting filter in query to just to load only last 7 days data. But this is taking too much time to execute in ...
Anonymous
5 years agoNot applicable
Anonymous
You can just sort the date column in descending order, then add an index to filter to <=7. This should be faster. BTW, if you have duplicated date, you would need to group by before the index column.
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"Date", Order.Descending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Added Index", each [Index] <= 7)
in
#"Filtered Rows"
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
Hi , Thanks for ur reply
Indexing will not work in my case there are multiple rows for single date in my data