{"id":4041,"date":"2026-11-23T22:30:15","date_gmt":"2026-11-23T17:00:15","guid":{"rendered":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi"},"modified":"2026-11-23T22:30:42","modified_gmt":"2026-11-23T17:00:42","slug":"power-query-in-power-bi","status":"publish","type":"post","link":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi","title":{"rendered":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model"},"content":{"rendered":"<p>Power Query is the data preparation layer inside Power BI Desktop: you open it with Home, Transform data, and every cleaning step you take there is recorded and replayed automatically on each refresh. It connects to a source, filters, reshapes and combines tables, and only the finished result loads into the model where DAX and visuals take over. In Power BI the two things that matter most are which steps run at the database (query folding) and which queries load into the model at all.<\/p>\n<p>Power Query is the same engine in Excel and Power BI. Our lesson on Power Query in Excel covers the editor basics, combining files from a folder and unpivoting in detail, and this one does not repeat them. It covers what changes once your data comes from a database and ends up in a published Power BI model.<\/p>\n<h2>Where Power Query sits in Power BI<\/h2>\n<p>Data moves through Power BI in a fixed order: source, Power Query, model, report. Power Query is the only stage where rows are removed or reshaped; after Close and Apply, the model holds whatever Power Query produced.<\/p>\n<table>\n<thead>\n<tr>\n<th>Task<\/th>\n<th>Click path in Power BI Desktop<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Open the editor<\/td>\n<td>Home ribbon, Transform data<\/td>\n<\/tr>\n<tr>\n<td>Connect to a new source from inside the editor<\/td>\n<td>Home ribbon, New Source<\/td>\n<\/tr>\n<tr>\n<td>See every step of a query<\/td>\n<td>Query Settings pane on the right, Applied Steps<\/td>\n<\/tr>\n<tr>\n<td>See the M code for a query<\/td>\n<td>Home ribbon, Advanced Editor<\/td>\n<\/tr>\n<tr>\n<td>Check data quality<\/td>\n<td>View ribbon, tick Column quality, Column distribution and Column profile<\/td>\n<\/tr>\n<tr>\n<td>See how queries feed each other<\/td>\n<td>View ribbon, Query Dependencies<\/td>\n<\/tr>\n<tr>\n<td>Commit and load<\/td>\n<td>Home ribbon, Close and Apply<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>What changes from Excel to Power BI<\/h2>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>Power Query in Excel<\/th>\n<th>Power Query in Power BI<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Where results go<\/td>\n<td>A worksheet table, a PivotTable or the Data Model<\/td>\n<td>Always the Power BI model, unless you switch loading off<\/td>\n<\/tr>\n<tr>\n<td>Typical source<\/td>\n<td>Files and folders<\/td>\n<td>Databases as often as files<\/td>\n<\/tr>\n<tr>\n<td>Query folding<\/td>\n<td>Rarely matters<\/td>\n<td>Decides whether refresh takes seconds or an hour<\/td>\n<\/tr>\n<tr>\n<td>Parameters<\/td>\n<td>Possible, rarely used<\/td>\n<td>Used for server names and incremental refresh<\/td>\n<\/tr>\n<tr>\n<td>Refresh after sharing<\/td>\n<td>Someone opens the workbook and clicks Refresh<\/td>\n<td>The Power BI Service runs it on a schedule, through a gateway if the source is on premises<\/td>\n<\/tr>\n<tr>\n<td>Shared logic<\/td>\n<td>Copy the query to another workbook<\/td>\n<td>Dataflows in the Service let several models reuse one set of steps<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>The data used throughout<\/h2>\n<p>An Ahmedabad pharmaceutical distributor supplies stockists across Gujarat. The sales head wants monthly sales against target by district. There are three sources.<\/p>\n<p><strong>invoices<\/strong>, a table in the company&#8217;s SQL Server database (only eight rows shown; the real table has several lakh):<\/p>\n<table>\n<thead>\n<tr>\n<th>invoice_no<\/th>\n<th>invoice_date<\/th>\n<th>stockist_code<\/th>\n<th>amount<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>INV-5101<\/td>\n<td>2026-04-03<\/td>\n<td>ST01<\/td>\n<td>42500<\/td>\n<\/tr>\n<tr>\n<td>INV-5102<\/td>\n<td>2026-04-11<\/td>\n<td>ST02<\/td>\n<td>18200<\/td>\n<\/tr>\n<tr>\n<td>INV-5103<\/td>\n<td>2026-04-25<\/td>\n<td>ST03<\/td>\n<td>27900<\/td>\n<\/tr>\n<tr>\n<td>INV-5104<\/td>\n<td>2026-05-06<\/td>\n<td>ST01<\/td>\n<td>39800<\/td>\n<\/tr>\n<tr>\n<td>INV-5105<\/td>\n<td>2026-05-14<\/td>\n<td>ST04<\/td>\n<td>22600<\/td>\n<\/tr>\n<tr>\n<td>INV-5106<\/td>\n<td>2026-05-29<\/td>\n<td>ST02<\/td>\n<td>16400<\/td>\n<\/tr>\n<tr>\n<td>INV-5107<\/td>\n<td>2026-06-09<\/td>\n<td>ST03<\/td>\n<td>31200<\/td>\n<\/tr>\n<tr>\n<td>INV-5108<\/td>\n<td>2026-06-21<\/td>\n<td>ST04<\/td>\n<td>25300<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>stockists<\/strong>, an Excel sheet kept by the sales team, with the kind of mess that sheets accumulate:<\/p>\n<table>\n<thead>\n<tr>\n<th>stockist_code<\/th>\n<th>stockist_name<\/th>\n<th>district<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>ST01<\/td>\n<td>Sabarmati Medical Agencies<\/td>\n<td>Ahmedabad<\/td>\n<\/tr>\n<tr>\n<td>ST02<\/td>\n<td>Maninagar Pharma<\/td>\n<td>ahmedabad<\/td>\n<\/tr>\n<tr>\n<td>ST03<\/td>\n<td>Alkapuri Medicos<\/td>\n<td>Vadodara<\/td>\n<\/tr>\n<tr>\n<td>ST04<\/td>\n<td>Varachha Distributors<\/td>\n<td>Surat<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>targets<\/strong>, an Excel sheet from finance, one column per month:<\/p>\n<table>\n<thead>\n<tr>\n<th>district<\/th>\n<th>Apr 2026<\/th>\n<th>May 2026<\/th>\n<th>Jun 2026<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Ahmedabad<\/td>\n<td>60000<\/td>\n<td>55000<\/td>\n<td>50000<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>25000<\/td>\n<td>25000<\/td>\n<td>30000<\/td>\n<\/tr>\n<tr>\n<td>Surat<\/td>\n<td>20000<\/td>\n<td>22000<\/td>\n<td>24000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Step 1: Connect to SQL Server and keep the query folding<\/h2>\n<p>Home ribbon, Get data, SQL Server. Enter the server and database, and choose a Data Connectivity mode. <strong>Import<\/strong> copies the data into the model and is the right default. <strong>DirectQuery<\/strong> leaves it in the database and queries it each time a visual loads, which suits very large or near-real-time data at the cost of speed and DAX restrictions.<\/p>\n<p>Then shape the invoices query in this order:<\/p>\n<table>\n<thead>\n<tr>\n<th>Step<\/th>\n<th>Click path<\/th>\n<th>Folds to SQL Server<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Keep only this financial year<\/td>\n<td>Filter arrow on invoice_date, Date Filters, After or Equal, 01-04-2026<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Remove unneeded columns<\/td>\n<td>Home ribbon, Choose Columns<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Add a month column<\/td>\n<td>Select invoice_date, Add Column ribbon, Date, Month, Start of Month<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Total by stockist and month<\/td>\n<td>Home ribbon, Group By, Advanced, group on stockist_code and Start of Month, Sum of amount<\/td>\n<td>Yes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Query folding<\/strong> means Power Query translates your steps into one SQL query and lets the database do the work. Filtering several lakh rows at the server and receiving a few hundred grouped rows is far faster than downloading every invoice and filtering on your laptop. To check, right-click the last step in Applied Steps: if View Native Query is available, the query still folds, and you can read the SQL it sends. Applied Steps also shows a small indicator beside each step saying whether it folds.<\/p>\n<p>Folding stops at the first step the source cannot translate, and every step after that runs in Power BI. Some steps never fold against SQL Server, such as adding an index column or merging with an Excel file. So order matters: do the filtering, column removal and grouping first, while folding still holds, and anything that breaks folding last.<\/p>\n<h2>Step 2: Profile the columns before you clean<\/h2>\n<p>Open the stockists query and switch on the View ribbon&#8217;s three profiling options. Under each column header you now see the share of valid, error and empty values, a mini histogram, and the count of distinct and unique values. Select the district column and Column profile shows 4 distinct values where the sales head expects 3, because it counts &#8220;Ahmedabad&#8221; and &#8220;ahmedabad&#8221; separately.<\/p>\n<p>One setting matters: by default profiling reads only the first 1,000 rows. Click &#8220;Column profiling based on top 1000 rows&#8221; in the status bar at the bottom and switch it to the entire data set before trusting the counts on a large table.<\/p>\n<h2>Step 3: Clean the stockist list<\/h2>\n<table>\n<thead>\n<tr>\n<th>Fix<\/th>\n<th>Click path<\/th>\n<th>M function it writes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Remove stray spaces<\/td>\n<td>Select district, Transform ribbon, Format, Trim<\/td>\n<td>Table.TransformColumns with Text.Trim<\/td>\n<\/tr>\n<tr>\n<td>Standardise case<\/td>\n<td>Transform ribbon, Format, Capitalize Each Word<\/td>\n<td>Table.TransformColumns with Text.Proper<\/td>\n<\/tr>\n<tr>\n<td>Fix a known misspelling<\/td>\n<td>Transform ribbon, Replace Values<\/td>\n<td>Table.ReplaceValue<\/td>\n<\/tr>\n<tr>\n<td>Set types<\/td>\n<td>Click the type icon on each column header<\/td>\n<td>Table.TransformColumnTypes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Power Query is case-sensitive in comparisons and merges, unlike Excel formulas, so &#8220;ahmedabad&#8221; and &#8220;Ahmedabad&#8221; would become two districts in every visual. Standardising case here fixes it once, for every refresh.<\/p>\n<h2>Step 4: Combine the three sources<\/h2>\n<p><strong>Bring district into invoices.<\/strong> In the invoices query, Home ribbon, Merge Queries, choose stockists, match on stockist_code, Join Kind Left Outer. Expand the new column and tick only district. This merge crosses from SQL Server to Excel, so folding ends here, which is why the grouping happened first.<\/p>\n<p><strong>Total by district and month.<\/strong> Group By again, on district and Start of Month. The result:<\/p>\n<table>\n<thead>\n<tr>\n<th>district<\/th>\n<th>Month<\/th>\n<th>Actual<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Ahmedabad<\/td>\n<td>Apr 2026<\/td>\n<td>60700<\/td>\n<\/tr>\n<tr>\n<td>Ahmedabad<\/td>\n<td>May 2026<\/td>\n<td>56200<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>Apr 2026<\/td>\n<td>27900<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>Jun 2026<\/td>\n<td>31200<\/td>\n<\/tr>\n<tr>\n<td>Surat<\/td>\n<td>May 2026<\/td>\n<td>22600<\/td>\n<\/tr>\n<tr>\n<td>Surat<\/td>\n<td>Jun 2026<\/td>\n<td>25300<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Reshape targets.<\/strong> Select the district column, Transform ribbon, Unpivot Columns dropdown, Unpivot Other Columns, rename the result to Month and Target, then change Month&#8217;s type to Date. The Excel lesson walks through this step in detail.<\/p>\n<p><strong>Merge actuals onto targets.<\/strong> Start from targets, Merge Queries with the district actuals on district and Month, Join Kind Left Outer, and expand Actual. Starting from targets matters: a month with a target and no sales still appears, with Actual as null. Replace null with 0 using Transform ribbon, Replace Values.<\/p>\n<p>Load that table, and a DAX measure, Achievement = DIVIDE(SUM(sales_vs_target[Actual]), SUM(sales_vs_target[Target])), returns:<\/p>\n<table>\n<thead>\n<tr>\n<th>district<\/th>\n<th>Month<\/th>\n<th>Target<\/th>\n<th>Actual<\/th>\n<th>Achievement<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Ahmedabad<\/td>\n<td>Apr 2026<\/td>\n<td>60000<\/td>\n<td>60700<\/td>\n<td>101.2%<\/td>\n<\/tr>\n<tr>\n<td>Ahmedabad<\/td>\n<td>May 2026<\/td>\n<td>55000<\/td>\n<td>56200<\/td>\n<td>102.2%<\/td>\n<\/tr>\n<tr>\n<td>Ahmedabad<\/td>\n<td>Jun 2026<\/td>\n<td>50000<\/td>\n<td>0<\/td>\n<td>0.0%<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>Apr 2026<\/td>\n<td>25000<\/td>\n<td>27900<\/td>\n<td>111.6%<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>May 2026<\/td>\n<td>25000<\/td>\n<td>0<\/td>\n<td>0.0%<\/td>\n<\/tr>\n<tr>\n<td>Vadodara<\/td>\n<td>Jun 2026<\/td>\n<td>30000<\/td>\n<td>31200<\/td>\n<td>104.0%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Surat shows 0.0% in April, then 102.7% in May and 105.4% in June. Had the merge started from actuals, the three zero months would have vanished, and the sales head would never have seen them. Keep the ratio as a DAX measure rather than a Power Query column, so that a quarter&#8217;s achievement is computed from the quarter&#8217;s totals and not averaged from the months.<\/p>\n<h2>Step 5: Decide what loads into the model<\/h2>\n<p>Every query loads into the model by default, and that is usually wrong. The stockists, targets and grouped invoices queries were steps on the way; only the final table and real lookup tables belong in the model.<\/p>\n<table>\n<thead>\n<tr>\n<th>Setting<\/th>\n<th>Where<\/th>\n<th>Use it for<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Enable load<\/td>\n<td>Right-click a query in the Queries pane, untick Enable load<\/td>\n<td>Staging queries; the name turns italic and nothing loads<\/td>\n<\/tr>\n<tr>\n<td>Include in report refresh<\/td>\n<td>Same right-click menu<\/td>\n<td>A static table you do not want refreshed<\/td>\n<\/tr>\n<tr>\n<td>Reference<\/td>\n<td>Right-click a query, Reference<\/td>\n<td>A new query that starts from another&#8217;s output, so a shared cleaning step lives in one place<\/td>\n<\/tr>\n<tr>\n<td>Duplicate<\/td>\n<td>Right-click a query, Duplicate<\/td>\n<td>A full independent copy of every step, for when the two will diverge<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Reference is the one to reach for. If invoices feeds two tables, reference it twice; fix a step once, and both follow. Duplicate copies the bug along with the steps.<\/p>\n<h2>Parameters: the server name and incremental refresh<\/h2>\n<p>Home ribbon, Manage Parameters, New Parameter. Create ServerName as Text, then edit the source step to use it: Sql.Database(ServerName, &#8220;sales&#8221;). Moving from a test server to production then means changing one value, and after publishing, the parameter can be edited in the Service under the semantic model&#8217;s settings.<\/p>\n<p>Two parameters are special. Create RangeStart and RangeEnd, both of type Date\/Time, filter invoice_date between them, and you can then set <strong>incremental refresh<\/strong>: right-click the invoices table in Desktop&#8217;s Data pane, Incremental refresh, and choose how many years to keep and how many recent days to refresh. The Service then reloads only recent rows each night instead of the whole table. It works on Pro as well as Premium, and it relies on the filter folding to the source.<\/p>\n<h2>M, briefly<\/h2>\n<p>Every click writes a line of M, Power Query&#8217;s formula language. You rarely need to type it, but reading it helps when a step fails. A query is a single let expression: each step is a named variable built from the step before, and in returns the last one. Step names with spaces are written as #&#8221;Changed Type&#8221;. M is case-sensitive, so Text.Trim works and text.trim does not.<\/p>\n<table>\n<thead>\n<tr>\n<th>Step in this lesson<\/th>\n<th>M it produces (simplified)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Connect<\/td>\n<td>Source = Sql.Database(ServerName, &#8220;sales&#8221;)<\/td>\n<\/tr>\n<tr>\n<td>Filter dates<\/td>\n<td>Table.SelectRows(dbo_invoices, each [invoice_date] &gt;= #date(2026, 4, 1))<\/td>\n<\/tr>\n<tr>\n<td>Month column<\/td>\n<td>Table.AddColumn(#&#8221;Removed Other Columns&#8221;, &#8220;Start of Month&#8221;, each Date.StartOfMonth([invoice_date]))<\/td>\n<\/tr>\n<tr>\n<td>Group<\/td>\n<td>Table.Group(#&#8221;Inserted Start of Month&#8221;, {&#8220;stockist_code&#8221;, &#8220;Start of Month&#8221;}, {{&#8220;amount&#8221;, each List.Sum([amount]), type number}})<\/td>\n<\/tr>\n<tr>\n<td>Merge<\/td>\n<td>Table.NestedJoin(#&#8221;Grouped Rows&#8221;, {&#8220;stockist_code&#8221;}, stockists, {&#8220;stockist_code&#8221;}, &#8220;stockists&#8221;, JoinKind.LeftOuter)<\/td>\n<\/tr>\n<tr>\n<td>Unpivot<\/td>\n<td>Table.UnpivotOtherColumns(Source, {&#8220;district&#8221;}, &#8220;Month&#8221;, &#8220;Target&#8221;)<\/td>\n<\/tr>\n<tr>\n<td>Replace null<\/td>\n<td>Table.ReplaceValue(#&#8221;Expanded actuals&#8221;, null, 0, Replacer.ReplaceValue, {&#8220;Actual&#8221;})<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The word each is shorthand for a function applied to every row, and [amount] means that row&#8217;s amount. Read the Group line as: group by these two columns, and make a column called amount that sums each group&#8217;s amounts.<\/p>\n<h2>After publishing: refresh in the Service<\/h2>\n<p>Once the report is published, the Power BI Service runs these queries on a schedule. The SQL Server here sits in the distributor&#8217;s office, so refresh needs the on-premises data gateway installed on a machine that can reach the server, and the Excel files must be somewhere the gateway can see, ideally SharePoint or OneDrive rather than someone&#8217;s desktop. If several reports need the same cleaned stockist list, move that query into a dataflow in the Service, so one copy of the logic feeds them all.<\/p>\n<h2>Mistakes that break refresh or slow it down<\/h2>\n<p><strong>Breaking folding early.<\/strong> An index column or Excel merge in step two forces every later step to run on your machine against every row. Keep folding steps first.<\/p>\n<p><strong>Hard-coded file paths.<\/strong> A targets file in someone&#8217;s Downloads folder works on their laptop and nowhere else, including the gateway. Keep source files on SharePoint or a shared drive the gateway can reach, and use a parameter for the path.<\/p>\n<p><strong>Loading staging queries.<\/strong> Each one adds a table to the model, its own refresh time and a confusing name in the Data pane. Untick Enable load.<\/p>\n<p><strong>Trusting the automatic Changed Type step.<\/strong> Power Query guesses types from the first rows and hard-codes column names in that step. A renamed column at source then breaks refresh. Delete the automatic step and set types yourself, after the columns are final.<\/p>\n<p><strong>Doing in DAX what belongs here.<\/strong> Trimming text or splitting columns with DAX calculated columns makes the model bigger and slower. Shape once in Power Query; calculate in DAX.<\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>What is Power Query in Power BI?<\/h3>\n<p>Power Query is the data preparation tool inside Power BI Desktop, opened with Home, Transform data. It connects to sources, cleans and reshapes data, and records each step so it replays on every refresh. Only its output loads into the model, where DAX measures and visuals work with it.<\/p>\n<h3>What is the difference between Power Query and DAX?<\/h3>\n<p>Power Query shapes data before it loads: removing rows, fixing text, merging tables, unpivoting. DAX calculates on the loaded model: totals, ratios and time comparisons that respond to a reader&#8217;s filters. Use Power Query for anything done once per refresh, and DAX for anything that must change when someone clicks a slicer.<\/p>\n<h3>What is query folding in Power BI?<\/h3>\n<p>Query folding is Power Query translating your steps into a query the source runs itself, such as one SQL statement against a database. It lets the database filter and group millions of rows and send back only the result, which makes refresh much faster. Right-click a step and check whether View Native Query is available to see if it still folds.<\/p>\n<h3>Do I need to learn M for Power BI?<\/h3>\n<p>Not to start. Almost every step can be done by clicking, and Power Query writes the M for you. Reading M becomes useful when a refresh fails, when you need a parameter in a source step, or for a transformation no button offers. Writing it from scratch is a skill for later.<\/p>\n<h3>Is Power Query in Power BI the same as in Excel?<\/h3>\n<p>The engine, the editor and the M language are the same, so skills carry over directly. Power BI differs in where the results go, always into its model, and in what matters most: query folding against databases, parameters, incremental refresh and scheduled refresh in the Power BI Service.<\/p>\n<h3>Why is my Power Query refresh so slow?<\/h3>\n<p>Usually because folding broke early and Power BI is downloading every row to process locally, or because many staging queries are loading into the model. Move filters and column removal to the top, check View Native Query on the last step, untick Enable load on intermediate queries, and remove columns you do not use.<\/p>\n<h2>Where this fits in the bigger picture<\/h2>\n<p>Power Query does the unglamorous part of a report, and a good share of analyst interviews probe exactly that. Our <a href=\"https:\/\/www.skillovilla.com\/blogs\/power-bi-tutorial\">Power BI tutorial<\/a> shows where it sits in a full build, and our <a href=\"https:\/\/www.skillovilla.com\/blogs\/power-bi-interview-questions\">Power BI interview questions<\/a> include the folding and Merge versus Append questions. Merges are joins by another name, so our <a href=\"https:\/\/www.skillovilla.com\/blogs\/sql-joins\">SQL joins lesson<\/a> explains the join kinds well.<\/p>\n<p>SkilloVilla&#8217;s <a href=\"https:\/\/www.skillovilla.com\/tracks\/data-analytics-python\">Data Analytics with Python track<\/a> includes a Data Visualization in Power BI module on visualisation and dashboarding, alongside Excel, SQL and Python, with live classes, mentorship from working analysts and placement support.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Query in Power BI explained: connecting to SQL, query folding, profiling, merging, what loads to the model, parameters and the M behind each step.<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[200],"tags":[],"class_list":["post-4041","post","type-post","status-publish","format-standard","hentry","category-data-analytics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Power Query in Power BI: Clean and Shape Data Before It Reaches the Model<\/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:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model\" \/>\n<meta property=\"og:description\" content=\"Power Query in Power BI explained: connecting to SQL, query folding, profiling, merging, what loads to the model, parameters and the M behind each step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\" \/>\n<meta property=\"og:site_name\" content=\"SkilloVilla\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-23T17:00:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-23T17:00:42+00:00\" \/>\n<meta name=\"author\" content=\"SkilloVilla Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"SkilloVilla Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\"},\"author\":{\"name\":\"SkilloVilla Team\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943\"},\"headline\":\"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model\",\"datePublished\":\"2026-11-23T17:00:15+00:00\",\"dateModified\":\"2026-11-23T17:00:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\"},\"wordCount\":2551,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\"},\"articleSection\":[\"Data analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\",\"name\":\"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model\",\"isPartOf\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#website\"},\"datePublished\":\"2026-11-23T17:00:15+00:00\",\"dateModified\":\"2026-11-23T17:00:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.skillovilla.com\/blogs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#website\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/\",\"name\":\"SkilloVilla\",\"description\":\"Data careers, taught live\",\"publisher\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.skillovilla.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\",\"name\":\"SkilloVilla\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png\",\"contentUrl\":\"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png\",\"width\":1200,\"height\":627,\"caption\":\"SkilloVilla\"},\"image\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943\",\"name\":\"SkilloVilla Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g\",\"caption\":\"SkilloVilla Team\"},\"url\":\"https:\/\/www.skillovilla.com\/blogs\/author\/sankalp_agarwal\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model","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:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi","og_locale":"en_US","og_type":"article","og_title":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model","og_description":"Power Query in Power BI explained: connecting to SQL, query folding, profiling, merging, what loads to the model, parameters and the M behind each step.","og_url":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi","og_site_name":"SkilloVilla","article_published_time":"2026-11-23T17:00:15+00:00","article_modified_time":"2026-11-23T17:00:42+00:00","author":"SkilloVilla Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"SkilloVilla Team","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#article","isPartOf":{"@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi"},"author":{"name":"SkilloVilla Team","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943"},"headline":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model","datePublished":"2026-11-23T17:00:15+00:00","dateModified":"2026-11-23T17:00:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi"},"wordCount":2551,"commentCount":0,"publisher":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#organization"},"articleSection":["Data analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi","url":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi","name":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model","isPartOf":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#website"},"datePublished":"2026-11-23T17:00:15+00:00","dateModified":"2026-11-23T17:00:42+00:00","breadcrumb":{"@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skillovilla.com\/blogs\/power-query-in-power-bi#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skillovilla.com\/blogs"},{"@type":"ListItem","position":2,"name":"Power Query in Power BI: Clean and Shape Data Before It Reaches the Model"}]},{"@type":"WebSite","@id":"https:\/\/www.skillovilla.com\/blogs\/#website","url":"https:\/\/www.skillovilla.com\/blogs\/","name":"SkilloVilla","description":"Data careers, taught live","publisher":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skillovilla.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skillovilla.com\/blogs\/#organization","name":"SkilloVilla","url":"https:\/\/www.skillovilla.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png","contentUrl":"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png","width":1200,"height":627,"caption":"SkilloVilla"},"image":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943","name":"SkilloVilla Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g","caption":"SkilloVilla Team"},"url":"https:\/\/www.skillovilla.com\/blogs\/author\/sankalp_agarwal"}]}},"_links":{"self":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/comments?post=4041"}],"version-history":[{"count":1,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4041\/revisions"}],"predecessor-version":[{"id":4042,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4041\/revisions\/4042"}],"wp:attachment":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/media?parent=4041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/categories?post=4041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/tags?post=4041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}