Forum Discussion
filter by date without losing query folding
- 3 years ago
Hi Anonymous
Changing the data type of a column in Power Query Editor will break query folding, so please delete the "Changed type" step. Then you can try Anonymous 's suggestions. If your date column in the data source is in number data type, filtering will not break query folding.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi there. I don't know if this was indeed "solved", as the solutions I read here did not work for me, but I have found a way to at least filter the dates without breaking them (for now). I may still have to change the column data type to 'date' at the end in order for my report to work correctly. Still, filtering dates dramatically lowers the amount of data my query must process, so doing it early on is a huge advantage. This filter removes over 80% of the data from the query right off the top.
Pretty simple solution. Using the Filter Rows function, I am filtering down to text that begins with 2021, 2022, and 2023. This eliminates all of the years I did not want in my report while keeping the ones that did. Now, I can make the transformations I want across the rest of the query, and if absolutely necessary I can change the data to 'date' at the end. That way the query folding will not break until there's the least amount of data left possible. I hope this helps!