What is PowerBI's query folding? Why does it enhance performance?

Power BI and Power Query can apply so-called “query folding”. Query folding in Power BI and Power Query forwards filters from subsequent steps into the actual download. Additionally, query folding can forward operations into to the actual source (the OData-download server).

This can extremely improve performance. For instance, it is 1.000x faster to download the last day’s transactions when the server just present the last day’s worth of transactions, instead of returning all transactions and Power BI locally filtering the data.

More information on query folding can be found in:

Query folding is also primarily available for OData feeds from Invantive Cloud. However, to view the native query please use Invantive Bridge Online Monitoring. Currently Power BI Desktop does not offer the native query view for folding in Power BI with OData-based sources.

Query folding is highly similar to “server-side filtering” offered by Invantive SQL when retrieving data sets from on many cloudplatforms. The Invantive SQL-engine incorporate filters (when possible) into the actual query on the sources such as a database or cloud platform. Server-side filtering can be combined with joins, where the join strategy may be altered given the characteristics of the data sets/tables selected.

Limitations

Not all operations are forwarded by query folding (see Understanding query evaluation and query folding in Power Query - Power Query | Microsoft Learn). For instance, search for a text at the start of a string is not forwarded, whereas “greater than” is available, but can not be selected in the user interface of Power BI and requires direct entry in Power Query.

Example

A filter on the name column on ActiveCampaign like in:

let
    Source = OData.Feed("https://bridge-online.cloud/invantive-activecampaign/odata4", null, [Implementation="2.0"]),
    #"ActiveCampaign.V3.Accounts@acn_table" = Source{[Name="ActiveCampaign.V3.Accounts@acn",Signature="table"]}[Data],
    #"Filtered Rows" = Table.SelectRows(#"ActiveCampaign.V3.Accounts@acn_table", each [name] > "Start")
in
    #"Filtered Rows"

is forwarded and results in the following Invantive SQL-query being executed:

select t.*
from   ActiveCampaign.V3.Accounts@acn t
where  ([name] > :w1)
OData-filters optimaliseren om de prestaties te verbeteren
Reduce OData Download Size by Sharing Data Sets in Power BI
Uren inladen vanuit Simplicate loopt vast Microsoft.Mashup.Evaluator.Interface.ErrorException
Failed to save modifications to the server: Invalid JSON. A comma character ‘,’ was expected in scope ‘Array’
Filter Power BI on Autotask ContractServiceUnits data
Use Power BI parameters with Invantive Bridge Online
Gebruik Power BI parameters met Invantive Bridge Online
Data filtering in Invantive voor dossier met enorm veel data
Vermijd time-out fout bij Power BI OData download
Views gebruiken om centraal te filteren voor Teamleader en Power BI
Avoid timeout error on Power BI OData download
400: Column not found: ::ancestor.project_id ((no parameters)). The remote server returned an error: (400) Bad Request
Improve performance of loading Exact Online data into Power BI
How do I create an Exact Online API interface?
Optimize OData Filters to Improve Performance
Gripp CRM connector - refresh tabel "Hours" traag
Reduce data volume and improve performance of your Power BI report by Filtering
Itgenoda055 Request timeout bij ophalen GLAccountClassificationMappings
Time-out bij het inlezen van TeamLeader tabel `Teamleader.V2Flat.InvoiceLinesAll` in PowerBI (itgenboe070)
Itgeneor229 API calls overschrijden voor TransactionLinesIncremental, SalesOrdersBulk en SalesOrderLinesBulk
Hoe maak ik Exact Online uren query op PjtTimeTransactions efficiënter?
Pre-load data in OData-cache to avoid Power BI timeouts
Forward filter on invoice_date for Teamleader Invoice lines
ExactOnlineREST.Incremental.TransactionLinesIncremental@EOL geeft "Too many rows"
Verminder hoeveelheid data en verbeter de prestaties van uw Power BI-rapport door te filteren
Fout: itgensql056 bij opvragen uren en projecten
Binnenhalen artikelvoorraden in Excel Power Query
Davista Power BI connector voor Exact Online omzetten naar Invantive Cloud
Davista Power BI connector voor Twinfield omzetten naar Invantive Cloud
Gripp - Hours tabel ververst langzaam op powerbi.com t.o.v. Power BI Desktop
Hours ophalen uit Gripp is traag
Uren inladen vanuit Simplicate loopt vast Microsoft.Mashup.Evaluator.Interface.ErrorException
Beperken datavolume Power BI bij "An existing connection was forcibly closed by the remote host."
Grote performancewinst bij real-time queries op gefilterde views met tabelfuncties
Major performance gains in real-time queries on filtered views with table functions
Verschillen Invantive Cloud en Exact Online Premium Power BI Connector
Strategieën voor het Efficiënt Laden van Meerdere Divisiecodes?
Wat zijn de aandachtspunten om Power BI te implementeren?
What are the critical points for implementing Power BI?
Odoo SQL-driver prestatieverbeteringen voor zeer grote Odoo-omgevingen
"updated_at" filter toevoegen in Simplicate aanroep Simplicate.Hours.Hours@spe
Odoo API data retrieval extremely slow and/or HTTP 502 Bad Gateway on Odoo API
Performance grootboekmutaties SnelStart / query folding
Performanceverbetering real-time queries op SnelStart
Incremental Refresh
Aanpassing om 1 divisie van Exact Online te laden in Power BI; Monitoring Bridge Online blijft 10 divisies laden
Itgenexl150: too many error requests bij ExactOnlineREST.Views.AROutstandingItemsPerFinancialPeriodUltimo
"updated_at" filter toevoegen in Simplicate aanroep Simplicate.Hours.Hours@spe
Odoo SQL-driver performance improvements for very large Odoo environments
SQL and Power BI Autotask performance improvements
OData Exact Online filter performance