{"id":2027,"date":"2026-09-16T08:48:50","date_gmt":"2026-09-16T08:48:50","guid":{"rendered":"https:\/\/entri.app\/explore\/?post_type=curriculum&#038;p=2027"},"modified":"2026-09-18T10:03:02","modified_gmt":"2026-09-18T10:03:02","slug":"query-folding-in-power-bi","status":"publish","type":"curriculum","link":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/","title":{"rendered":"Query Folding in Power BI"},"content":{"rendered":"<h2>What Is Query Folding in Power BI?<\/h2>\n<p>Query folding in Power BI is the ability of Power Query to translate transformation steps into native source queries (e.g., SQL statements) that run on the data source server instead of locally in Power Query&#8217;s engine. It is the single most important performance optimization in Power Query, because it pushes filtering, aggregation, and joins to the server \u2014 reducing data transferred and refresh time.<\/p>\n<h2>How Does Query Folding Work?<\/h2>\n<p>When you add steps in Power Query (filter rows, select columns, group by, merge), Power Query checks whether the underlying data source connector can express that step as a native query. If it can, the step &#8216;folds&#8217; \u2014 it becomes part of the SQL statement (or OData query, or other native request) sent to the server. If a step cannot fold, Power Query downloads the data up to the last folded step and processes the remaining steps locally.<\/p>\n<ul>\n<li>Steps that typically fold: Select Columns, Filter Rows, Sort, Group By, Merge (when both tables are from the same source), Remove Duplicates, Rename Columns.<\/li>\n<li>Steps that typically break folding: Add Custom Column (with M logic), Unpivot, Pivot, Merge with a local table, complex M functions.<\/li>\n<\/ul>\n<h2>How to Check If Query Folding Is Happening<\/h2>\n<p>Right-click any step in the Applied Steps pane. If &#8216;View Native Query&#8217; is available (not greyed out), that step and all steps above it have folded to the source. The native query window shows the exact SQL (or equivalent) that Power Query sends to the server. If &#8216;View Native Query&#8217; is greyed out, folding has broken at or before that step.<\/p>\n<h2>Why Is Query Folding Important?<\/h2>\n<ul>\n<li><b><\/b><strong><b>Performance: <\/b><\/strong>The server processes data far faster than the local Power Query engine, especially for large datasets.<\/li>\n<li><b><\/b><strong><b>Reduced data transfer: <\/b><\/strong>Only the filtered, aggregated result is sent to Power BI \u2014 not the entire raw table.<\/li>\n<li><b><\/b><strong><b>Incremental refresh: <\/b><\/strong>Power BI&#8217;s incremental refresh feature relies on query folding to partition data by date range at the source level.<\/li>\n<\/ul>\n<h2>How to Check and Preserve Query Folding in Power BI \u2014 Step-by-Step Tutorial<\/h2>\n<p>This tutorial shows you how to verify query folding on your Power Query steps and how to reorder transformations to preserve folding for better refresh performance. You will finish in 5 steps and under 10 minutes.<\/p>\n<h3>Steps<\/h3>\n<p><strong><b>Step 1: Open Power Query and select a query<\/b><\/strong><\/p>\n<p>Click Home \u2192 Transform Data. Select a query connected to your SQL database in the Queries pane.<\/p>\n<p><strong><b>Step 2: Check folding on the last step<\/b><\/strong><\/p>\n<p>In the Applied Steps pane, right-click the last step. If &#8216;View Native Query&#8217; is clickable, all steps have folded. Click it to see the SQL statement sent to the server.<\/p>\n<p><strong><b>Step 3: Identify where folding breaks<\/b><\/strong><\/p>\n<p>If &#8216;View Native Query&#8217; is greyed out on the last step, work backwards: right-click earlier steps until you find the last one where it is available. The step immediately after that is where folding breaks.<\/p>\n<p><strong><b>Step 4: Reorder to preserve folding<\/b><\/strong><\/p>\n<p>Move foldable steps (filters, column selections) before non-foldable ones (custom columns, pivots). This maximizes the work done by the server. For example, filter rows before adding a custom M column, not after.<\/p>\n<p><strong><b>Step 5: Verify the improvement<\/b><\/strong><\/p>\n<p>After reordering, check &#8216;View Native Query&#8217; again on the last foldable step \u2014 confirm the filter appears in the SQL WHERE clause. Refresh the dataset and compare load time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Is Query Folding in Power BI? Query folding in Power BI is the ability of Power Query to translate transformation steps into native source queries (e.g., SQL statements) that run on the data source server instead of locally in Power Query&#8217;s engine. It is the single most important performance optimization in Power Query, because [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","meta":{"_acf_changed":false},"curriculum-category":[90,91,132],"custom_linking_tags":[],"class_list":["post-2027","curriculum","type-curriculum","status-publish","hentry","curriculum-category-power-bi","curriculum-category-power-bi-tutorials","curriculum-category-merging-queries"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Query Folding in Power BI<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Query Folding in Power BI\" \/>\n<meta property=\"og:description\" content=\"What Is Query Folding in Power BI? Query folding in Power BI is the ability of Power Query to translate transformation steps into native source queries (e.g., SQL statements) that run on the data source server instead of locally in Power Query&#8217;s engine. It is the single most important performance optimization in Power Query, because [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Free Materials\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-18T10:03:02+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/\",\"url\":\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/\",\"name\":\"Query Folding in Power BI\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/explore\/#website\"},\"datePublished\":\"2026-09-16T08:48:50+00:00\",\"dateModified\":\"2026-09-18T10:03:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/explore\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Query Folding in Power BI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/explore\/#website\",\"url\":\"https:\/\/entri.app\/explore\/\",\"name\":\"Entri Free Materials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/explore\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/explore\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/explore\/#organization\",\"name\":\"Entri Free Materials\",\"url\":\"https:\/\/entri.app\/explore\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"contentUrl\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"caption\":\"Entri Free Materials\"},\"image\":{\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Query Folding in Power BI","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/","og_locale":"en_US","og_type":"article","og_title":"Query Folding in Power BI","og_description":"What Is Query Folding in Power BI? Query folding in Power BI is the ability of Power Query to translate transformation steps into native source queries (e.g., SQL statements) that run on the data source server instead of locally in Power Query&#8217;s engine. It is the single most important performance optimization in Power Query, because [&hellip;]","og_url":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/","og_site_name":"Entri Free Materials","article_modified_time":"2026-09-18T10:03:02+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/","url":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/","name":"Query Folding in Power BI","isPartOf":{"@id":"https:\/\/entri.app\/explore\/#website"},"datePublished":"2026-09-16T08:48:50+00:00","dateModified":"2026-09-18T10:03:02+00:00","breadcrumb":{"@id":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/explore\/power-bi\/query-folding-in-power-bi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/explore\/"},{"@type":"ListItem","position":2,"name":"Query Folding in Power BI"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/explore\/#website","url":"https:\/\/entri.app\/explore\/","name":"Entri Free Materials","description":"","publisher":{"@id":"https:\/\/entri.app\/explore\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/explore\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/explore\/#organization","name":"Entri Free Materials","url":"https:\/\/entri.app\/explore\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/","url":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","contentUrl":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","caption":"Entri Free Materials"},"image":{"@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum\/2027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum"}],"about":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/types\/curriculum"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/users\/2"}],"wp:attachment":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/media?parent=2027"}],"wp:term":[{"taxonomy":"curriculum-category","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum-category?post=2027"},{"taxonomy":"custom_linking_tags","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/custom_linking_tags?post=2027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}