Power Query from Scratch, Part 5: Parameters, functions and a model that refreshes itself
A hardcoded folder path and a copy-pasted business rule are the same problem, and parameters plus functions are how you stop editing M code every month.
Tutorials, tips, and deep dives on Excel — every post from bianca.codes tagged Excel.
A hardcoded folder path and a copy-pasted business rule are the same problem, and parameters plus functions are how you stop editing M code every month.
Seven days actually driving Copilot across Excel, Word and PowerPoint - the wins, the confidently wrong deck, and the habit that mattered more than any prompt.
Three parts of buttons, then a request that needs an 'and' the Conditional Column dialog doesn't have - time to type your first line of M.
One clean Excel table and a Word template are all it takes for forty personalised reports, once the wizard is driven properly.
The first time a plain-English request turns into a real, inspectable Excel formula, the tool stops feeling abstract - and the habit that keeps it honest.
The one Copilot prompt that turns twenty unlabelled tabs into a sheet-by-sheet summary, outliers included, in under a minute.
Unpivot, split column and group by all look foolproof, right up until the source file adds a column or a name gets typed slightly differently than expected.
One drop-down cell, four XLOOKUP formulas, and every number on the dashboard updates itself - no PivotTable, no slicer, no VBA in sight.
Two tabs open, four spare hours a week, and everyone insisting the other tab is a waste of your time - here's the no-hype version of the beginner's fork.
Files, folders, and multiple sheets go in three different ways, and the append-versus-merge decision is where most people guess wrong.
Most Copilot opinions come from people who've never clicked into it. Open the thing for an afternoon and form one that's actually yours.
Paste Link turns three Excel cells into a PowerPoint object that updates itself, once you stop letting the linked range look like a spreadsheet.
Copy-pasting the same formula across a workbook used to be the only way to reuse logic - until LAMBDA let you name it and call it like any other Excel function.
Nobody decided to build a database out of that 80-tab workbook - it ended up doing a database's job without any of a database's guarantees.
Stop typing dollar signs by hand - one keystroke cycles through every Excel cell reference mode instantly.
Most people learn Power Query by clicking through wizards. Nobody explains what it's actually doing - and that gap is why queries break in confusing ways.
A formula with six nested IFs works fine, right up until the rule changes and you're reverse-engineering a 300-character one-liner you wrote six months ago.
Python in Excel can't write a file, but it can turn a transaction table into a chart that lives in the workbook and never goes stale - in one =PY() cell.
For forty years an Excel cell could hold one of four things, and Python in Excel quietly added a fifth: a whole pandas DataFrame, living inside a single cell.
The mechanics of cleaning data are the straightforward part. The hard part has no function and no checklist: deciding which imperfections actually matter, and stopping there.
Copying a query and tweaking the copy feels efficient. It isn't - three copies of the same logic is three places to update and three ways for it to drift.
The same trim-and-title-case steps are copy-pasted across three of your queries - write them once as a function instead, and fix the rule in one place.
You've built the same cleanup steps in four different queries. A custom function is how you write them once and call them from all four.
Pivot tables aren't obsolete, but reaching for one by reflex on every new analysis is a quiet tax GROUPBY does not charge.
A raw transaction table becomes a monthly sales summary by category with one GROUPBY formula - no PivotTable, no Refresh, and it updates the moment you add a row.
A pivot table is a tool you operate. GROUPBY is the same group-and-aggregate logic as a single spilled formula - the summary recalculates itself, with no fields to drag and nothing to refresh.
A pivot table is a snapshot that needs refreshing. GROUPBY is a formula that recalculates itself. Swapping one for the other takes about 90 seconds and removes a recurring chore.
REDUCE is the most powerful of the functional array functions and the most overlooked. The lambda which means you can accumulate strings, and replace calculations that used to need VBA.
Joining a column of names or tags into one comma-separated string used to need TEXTJOIN or a helper column. REDUCE does it in one formula, and lets you transform each item before it gets concatenated.
LAMBDA, MAP, REDUCE, SCAN, BYROW. These are functional programming primitives. Excel is shipping them one by one, and most users are still writing nested IFs. The spreadsheet you learned in 2015 has been quietly replaced by something much more powerful.
You'll build a dropdown list that reads from a structured table and includes every new row automatically. No named range maintenance, no 'why isn't my new entry showing up' moments.
MAP takes your LAMBDA and runs it on every element in an array. No helper columns, no dragging formulas, no VBA loops.
In a small team, you're the analyst, the engineer, the dashboard designer, and the person who explains what a p-value is at the all-hands.
The analysts who get traction aren't the fastest at pulling data, they're the best at unpacking what was actually being asked. The skill is asking good questions, and nobody trains for it.
Step-by-step from a blank flow, including how to handle the parts that break the first time.
Automation bias is real: if you can automate something, it feels like you should. But some processes contain judgement calls that automation silently gets wrong, edge cases that require human revie…
You can't build every dashboard that gets requested. But 'no' lands differently depending on how you say it — and most data people either say yes to everything and resent it, or say no in ways that…
You'll build a summary that calculates a custom metric for every row in your dataset without a pivot table, without helper columns, and without copying formulas down. BYROW plus a LAMBDA gives you …
BYROW hands your function an entire row at a time. BYCOL does the same by column. Together they replace an entire category of 'drag this formula down and keep it updated' work — and when you combin…
XLOOKUP, LET, LAMBDA, BYROW, SCAN, MAP — Microsoft shipped more genuinely useful functions in the last three years than in the previous decade. If you learned Excel before 2022 and haven't revisite…
BYROW hands your function an entire row at a time — which means 'apply this logic to every row in this range' is one formula in one cell. No dragging, no CTRL+SHIFT+ENTER, no missing the last row w…
The more competent you get, the less people see the effort behind what you deliver. A clean dashboard looks effortless. A fast turnaround looks like it was always fast.
Helper columns aren't wrong. But when a running total requires three of them and breaks every time someone inserts a row, you've created fragility in exchange for familiarity. The Excel array funct…
You'll build a balance tracker using SCAN and a structured table that extends itself as new rows come in. No helper columns, no fragile cell references, no 'just re-paste the formula down.' Add a r…
Running totals used to mean helper columns or array gymnastics. SCAN changes that — it applies a function cumulatively across an array and hands you back every intermediate result. Once you see it …
Most dashboards answer the question 'what happened?' Very few answer 'what should we do?' The gap isn't data — it's intent. A dashboard built for the former often actively gets in the way of the la…
SCAN hands you every intermediate result as it accumulates — which means a running total is one formula that spills down the column. No helper rows, no dragging, no breaking when someone inserts a …
They ask for a pie chart when they need a bar chart. They ask for a table when they need a trend line. This isn't ignorance — it's that they're translating a question into a visual type without kno…
The counter-argument to 'if your formula needs a scrollbar to read, it's wrong.' With LAMBDA, complexity lives in one named place and gets called cleanly everywhere else. The formula in your cell c…
You'll build a named LAMBDA called OVERDUE that takes a date and a threshold and returns a clean status label. Then you'll call it in three different tables in the same workbook. By the end, you'll…
Before LAMBDA, every Excel function that existed was one Microsoft decided to write. After LAMBDA, you can write them yourself — naming the logic, hiding the complexity, and calling your custom fun…
One function definition in the Name Manager, and every cell in the workbook can call it like a built-in. LAMBDA + named functions means you stop copy-pasting logic and start writing like someone wh…
You delivered a clean model, a solid dashboard, a real solution — and got a blank look in the room. The work was right. But explaining technical work to someone who doesn't share your frame of refe…
You'll build a reusable Power Query that finds the most recent entry per group - the kind of query that normally tempts people into messy MAXIFS workarounds in Excel. We're doing it properly, wit…
Stop cringing. There's a way to talk about your accomplishments in Excel and Power BI that sounds competent, not arrogant. It's all about framing.
Complex formulas aren't the problem. Unreadable ones are. Before LET, you had to repeat the same range reference six times or accept that your formula was a black box. LET gives you named variables in
The advice is everywhere: if you're serious about data, you need SQL. But for most analysts already working in Excel and Power BI, the gap isn't SQL knowledge - it's data modelling instinct. Here…
One tweak to your most-used formula and it suddenly reads like plain English. LET() lets you name the messy middle parts — so next month's you won't need to reverse-engineer what current you was …
You deliver good work consistently, your manager knows you're reliable — and yet somehow you're invisible at promotion time. The problem isn't your output. It's that you've never made your work l…
It works, so why change it? Because every workaround you've added to compensate for VLOOKUP's limits is technical debt in your spreadsheet - and it compounds. The cost isn't visible until somethi…
Stop replacing VLOOKUPs. Your workbook deserves XLOOKUP without touching the formula.
I spent years writing 400-character Ctrl+Shift+Enter arrays just to filter a table, but the calculation engine finally changed the rules and killed that misery for good.
It is 2026, and we are still stringing together premium Power Automate connectors just to avoid the Word mail merge wizard.