Forum Discussion

Cymbolz's avatar
Cymbolz
Helper III
7 years ago
Solved

Filtering in Power Query Editor not working for OData source

I have an OData source, and when applying a column filter in PQ Editor the data is not at all filtered (same resulting rows as the step before filtering).  I've verified this not just in the preview,...
  • cwebb's avatar
    7 years ago

    This seems strange - it might be worth seeing whether query folding is taking place, and what your OData source actually returns, by using this technique: https://blog.crossjoin.co.uk/2018/05/03/troubleshooting-data-refresh-performance-issues-with-odata-data-sources-in-power-bi-and-excel-using-fiddler/

     

    If that reveals that the filter is being passed back to the datas source but the data source isn't applying the data, you could try the following:

     

    let
        Source = OData.Feed("https://REMOVED/", null, [Implementation="2.0"]),
        projects_table = Source{[Name="projects",Signature="table"]}[Data],
        buffer_table = Table.Buffer(projects_table),
        #"Filtered Rows" = Table.SelectRows(buffer_table, each ([IsArchived] = false))
    in
        #"Filtered Rows"

    This should load the whole of the projects_table table into memory, stop any query folding and force the filter to take place in the Power Query engine. Hopefully the table isn't too big, otherwise this will be slow.

     

    HTH,

     

    Chris