Search code examples
powerbidirectquery

How the datas are get in Power Bi (direct query) with a filter


I was wondering, when you get the data in power bi (with Direct Query) And you filter the data in the Power Query Editor.(Lignes filtrées = Filtered rows)

You will get the data first then you filter the data, or you filter the data first the you get the data?

enter image description here


Solution

  • Actually, both are data which contains different values.

    PowerBI is operating data from top to bottom. So, it gets the data from Source, then navigates to the selected table, then applies filters and some other jobs.

    So, getting the data first and then filtering it is meaningful because you can see all the data changes in the Edit Query page.

    But getting the data after filtering it in query may also meaningful because all the filtering is handled in database and if you have a good infrastructure, your data will come faster.

    And the best case approach is: "using filtering in queries is OK but don't be complex on your database queries". So, there is no correct answer for your question, you should just use a little bit of this and that depend on the quality of your data.