Stop duplicating queries for every region, tenant, or context variant. Learn how to use function currying in Power Query M to build argument-driven transformation pipelines you configure once and reuse everywhere — with realistic multi-region retail examples you can adapt immediately.

Imagine you're managing data pipelines for a retail company with 12 regional subsidiaries. Each region pulls sales data from the same SQL warehouse but needs slightly different transformations: different fiscal calendars, currency normalization thresholds, store-tier classifications, and date range filters. The naive solution is to copy your base query 12 times and hand-edit the parameters into each one. Within three months, you have 12 slightly different versions of the same logic, and fixing a bug means touching 12 files. You've traded a configuration problem for a maintenance nightmare.
The elegant solution is function currying — a technique where you transform a multi-argument function into a sequence of single-argument functions, each returning the next function in the chain until all arguments are supplied and the final computation runs. In M, this pattern lets you build parameterized transformation pipelines that are configured once and reused everywhere, with each context supplying only the arguments that differ. You write the logic once, bind the stable arguments early, and distribute lightweight configured variants to each consumer.
By the end of this lesson, you'll be able to design and implement production-grade curried function pipelines in Power Query M. You'll know when currying is the right tool, how to compose curried functions into multi-stage ETL chains, and how to avoid the performance and debugging traps that catch practitioners off guard.
What you'll learn:
You should be comfortable writing custom M functions, working with let…in expressions, and understanding how M evaluates expressions lazily. If you need a refresher, review Writing Custom M Functions from Scratch in Power Query and M Language Fundamentals: Syntax, Types, and Expressions for Power Query before continuing. You should also understand list and record manipulation — we'll lean on those heavily — so List and Record Operations in M: Transform, Select, and Combine Data Structures is worth having in your back pocket.
Before we write a single curried function, let's understand why M is well-suited for this pattern. M treats functions as first-class values. A function can be the return value of another function, stored in a record field, passed as an argument, or held in a list. This isn't just a curiosity — it's the structural property that makes currying possible.
Consider the difference between these two approaches to parameterizing a date filter:
Approach A: Monolithic function with all parameters
FilterSalesByDateAndRegion = (
sourceTable as table,
startDate as date,
endDate as date,
regionCode as text
) as table =>
let
dateFiltered = Table.SelectRows(
sourceTable,
each [SaleDate] >= startDate and [SaleDate] <= endDate
),
regionFiltered = Table.SelectRows(
dateFiltered,
each [RegionCode] = regionCode
)
in
regionFiltered
This works fine for one-off use, but every call site needs all four arguments. You can't partially configure it for a region and reuse that configured version elsewhere. Every consumer carries the full burden of supplying all context.
Approach B: Curried function
FilterSalesByRegion = (regionCode as text) =>
(startDate as date, endDate as date) =>
(sourceTable as table) =>
let
dateFiltered = Table.SelectRows(
sourceTable,
each [SaleDate] >= startDate and [SaleDate] <= endDate
),
regionFiltered = Table.SelectRows(
dateFiltered,
each [RegionCode] = regionCode
)
in
regionFiltered
Now you can create a region-specific filter with NortheastFilter = FilterSalesByRegion("NE"), then apply date ranges with NortheastQ1Filter = NortheastFilter(#date(2024,1,1), #date(2024,3,31)), and finally apply it to any table with NortheastQ1Filter(SalesTable). Each binding step produces a new function. The region is locked in; the dates are locked in; then the data is provided.
Key insight
Currying isn't about syntax tricks — it's about separating when you know something from when you use it. Stable context (like region configuration) gets bound early. Variable inputs (like the actual data table) get bound last. This matches the natural information flow in real ETL pipelines.
The most important design decision in a curried function is argument order. The rule is simple but counterintuitive at first: bind the most stable arguments first, the most variable arguments last.
Think about it this way. If you're building transformation functions for a multi-tenant reporting system:
This hierarchy dictates your currying chain. Here's a realistic example building a sales margin analysis pipeline:
// Query: fn_MarginAnalysis
// Arguments bound outermost-to-innermost: config → thresholds → table
fn_MarginAnalysis = (config as record) =>
// config contains: CurrencyCode, TaxRegime, FiscalYearStartMonth
(thresholds as record) =>
// thresholds contains: MinMarginPct, MaxDiscountPct, AlertThreshold
(salesTable as table) as table =>
let
// Apply currency normalization based on config
withCurrency = Table.AddColumn(
salesTable,
"NormalizedRevenue",
each [GrossRevenue] * Record.Field(config, "ExchangeRate"),
type number
),
// Calculate margin
withMargin = Table.AddColumn(
withCurrency,
"MarginPct",
each ([NormalizedRevenue] - [COGS]) / [NormalizedRevenue],
type number
),
// Flag rows below minimum margin threshold
withFlags = Table.AddColumn(
withMargin,
"BelowMinMargin",
each [MarginPct] < thresholds[MinMarginPct],
type logical
),
// Apply fiscal year context from config
withFiscalYear = Table.AddColumn(
withFlags,
"FiscalYear",
each
let
txMonth = Date.Month([SaleDate]),
fyStart = config[FiscalYearStartMonth],
calYear = Date.Year([SaleDate])
in
if txMonth >= fyStart then calYear else calYear - 1,
Int64.Type
)
in
withFiscalYear
Now create configured variants for two subsidiaries:
// Query: fn_MarginAnalysis_EMEA
EMEAConfig = [
CurrencyCode = "EUR",
ExchangeRate = 1.08,
FiscalYearStartMonth = 4 // April fiscal year start
],
fn_MarginAnalysis_EMEA = fn_MarginAnalysis(EMEAConfig)
// Query: fn_MarginAnalysis_APAC
APACConfig = [
CurrencyCode = "JPY",
ExchangeRate = 0.0067,
FiscalYearStartMonth = 7 // July fiscal year start
],
fn_MarginAnalysis_APAC = fn_MarginAnalysis(APACConfig)
Both fn_MarginAnalysis_EMEA and fn_MarginAnalysis_APAC are now functions waiting for a threshold record and then a table. You've captured the regional context without duplicating the transformation logic.
Warning
Don't be tempted to put the data table first "because it feels natural." If the table is the first argument, you can't create a configured variant — you'd have to supply the data before the configuration, which defeats the entire purpose. Always put stable context first.
Individual curried functions become truly powerful when you compose them into pipelines. M's let…in syntax makes composition readable. Let's build a complete multi-stage pipeline for a retail scenario.
You receive daily sales export files from point-of-sale systems. Each file needs: date normalization, product category enrichment, margin calculation, and regional compliance flagging. Different store tiers (flagship, standard, outlet) have different compliance thresholds. You need this pipeline to work for 50+ stores without 50+ query copies.
// Query: fn_NormalizeDates
fn_NormalizeDates = (fiscalYearStartMonth as number) =>
(dateColumnName as text) =>
(sourceTable as table) as table =>
let
withParsed = Table.TransformColumns(
sourceTable,
{
{
dateColumnName,
each if _ is text then Date.From(_) else _,
type date
}
}
),
withFiscalInfo = Table.AddColumn(
withParsed,
"FiscalPeriod",
each
let
d = Record.Field(_, dateColumnName),
m = Date.Month(d),
y = Date.Year(d),
fy = if m >= fiscalYearStartMonth then y else y - 1,
fp = Number.Mod(m - fiscalYearStartMonth + 12, 12) + 1
in
[FiscalYear = fy, FiscalPeriodNum = fp],
type record
)
in
withFiscalInfo
// Query: fn_EnrichCategories
fn_EnrichCategories = (categoryMapping as table) =>
(productKeyColumn as text) =>
(sourceTable as table) as table =>
let
joined = Table.NestedJoin(
sourceTable,
{productKeyColumn},
categoryMapping,
{"ProductKey"},
"CategoryData",
JoinKind.LeftOuter
),
expanded = Table.ExpandTableColumn(
joined,
"CategoryData",
{"CategoryName", "CategoryTier", "MerchandiseGroup"},
{"CategoryName", "CategoryTier", "MerchandiseGroup"}
)
in
expanded
Here's where the architecture pays off. Notice how each stage produces a table that feeds into the next:
// Query: BuildStorePipeline
BuildStorePipeline = (storeConfig as record) =>
let
// Bind stage 1: fiscal year configuration
DateNormalizer = fn_NormalizeDates(storeConfig[FiscalYearStartMonth])("SaleDate"),
// Bind stage 2: category mapping for this store's region
CategoryEnricher = fn_EnrichCategories(storeConfig[CategoryMappingTable])("ProductKey"),
// Bind stage 3: margin analysis with store-tier thresholds
MarginAnalyzer = fn_MarginAnalysis(storeConfig[RegionalConfig])(storeConfig[TierThresholds]),
// The composed pipeline: a single function from table to table
Pipeline = (rawTable as table) as table =>
let
step1 = DateNormalizer(rawTable),
step2 = CategoryEnricher(step1),
step3 = MarginAnalyzer(step2)
in
step3
in
Pipeline
Now creating a store-specific pipeline is a single call:
// Query: Pipeline_Store_NYC_Flagship
StoreNYCConfig = [
FiscalYearStartMonth = 2,
CategoryMappingTable = CategoryMappingNortheast,
RegionalConfig = [CurrencyCode = "USD", ExchangeRate = 1.0, FiscalYearStartMonth = 2],
TierThresholds = [MinMarginPct = 0.35, MaxDiscountPct = 0.20, AlertThreshold = 0.30]
],
Pipeline_Store_NYC_Flagship = BuildStorePipeline(StoreNYCConfig)
Apply it to actual data:
// Query: Sales_NYC_Flagship_Processed
Sales_NYC_Flagship_Processed = Pipeline_Store_NYC_Flagship(Sales_NYC_Flagship_Raw)
Tip
Store your config records in a dedicated config query or a shared parameter table. This separates configuration from logic entirely. When a store's fiscal year changes, you update one record field — the pipeline logic is untouched. See Cross-Query State Management and Shared Parameter Tables in Power Query M for patterns on centralizing this configuration.
Currying naturally enables partial application — binding some arguments now and deferring others. M doesn't have a built-in partial operator, but you don't need one. Here are three practical patterns you'll use constantly.
A factory function takes configuration and returns a configured function. We've already seen this, but let's make the pattern explicit:
// Factory: creates a text-cleaning function tuned for a specific locale
fn_CleanTextFactory = (locale as text, trimWhitespace as logical) =>
(columnNames as list) =>
(sourceTable as table) as table =>
let
transformSpec = List.Transform(
columnNames,
each {
_,
(val) =>
let
trimmed = if trimWhitespace then Text.Trim(val) else val,
normalized = Text.Lower(trimmed),
// Locale-specific character normalization
cleaned = if locale = "de-DE"
then Text.Replace(Text.Replace(normalized, "ß", "ss"), "ü", "ue")
else normalized
in
cleaned,
type text
}
),
result = Table.TransformColumns(sourceTable, transformSpec)
in
result,
// Create locale-specific cleaners
CleanText_German = fn_CleanTextFactory("de-DE", true),
CleanText_English = fn_CleanTextFactory("en-US", true)
Now CleanText_German and CleanText_English are both functions waiting for a column list and a table. Same factory, different configurations.
Predicates are the natural home for currying because filter conditions are almost always parameterized versions of the same logic:
// Build reusable filter predicates
fn_BuildDateRangeFilter = (startDate as date, endDate as date) =>
(dateColumn as text) =>
(row as record) as logical =>
let
dateValue = Record.Field(row, dateColumn)
in
dateValue >= startDate and dateValue <= endDate,
// Build a column-value filter
fn_BuildCategoryFilter = (allowedCategories as list) =>
(categoryColumn as text) =>
(row as record) as logical =>
List.Contains(allowedCategories, Record.Field(row, categoryColumn)),
// Compose predicates into a combined filter
fn_CombinePredicates = (predicates as list) =>
(row as record) as logical =>
List.AllTrue(List.Transform(predicates, each _(row)))
Using these together:
// Build a combined row filter for Q1 Electronics
Q1Filter = fn_BuildDateRangeFilter(#date(2024,1,1), #date(2024,3,31))("SaleDate"),
ElectronicsFilter = fn_BuildCategoryFilter({"Electronics", "Computing", "Mobile"})("CategoryName"),
// Compose them
Q1ElectronicsFilter = fn_CombinePredicates({Q1Filter, ElectronicsFilter}),
// Apply to any table
FilteredSales = Table.SelectRows(SalesTable, Q1ElectronicsFilter)
Note
fn_CombinePredicates takes a list of fully-bound predicates (functions from record to logical) and returns a new predicate that requires ALL of them to be true. This is a form of functional composition that's extremely useful for building dynamic filter logic without constructing M expression strings. For more on this style of conditional logic, see Conditional Logic and Dynamic Column Selection in Power Query M.
Sometimes you need to build up a transformation from a list of specifications. Currying makes this composable:
// Apply a list of column transformations built from a spec record
fn_BuildColumnTransformer = (transformSpec as list) =>
// transformSpec: list of records with fields: ColumnName, TransformFn, OutputType
(sourceTable as table) as table =>
let
tableTransformList = List.Transform(
transformSpec,
each {_[ColumnName], _[TransformFn], _[OutputType]}
),
result = Table.TransformColumns(sourceTable, tableTransformList)
in
result,
// Define a spec for revenue normalization
RevenueNormSpec = {
[
ColumnName = "GrossRevenue",
TransformFn = (x) => Number.Round(x * 1.08, 2),
OutputType = type number
],
[
ColumnName = "COGS",
TransformFn = (x) => Number.Round(x * 1.08, 2),
OutputType = type number
],
[
ColumnName = "ProductName",
TransformFn = (x) => Text.Upper(Text.Trim(x)),
OutputType = type text
]
},
// Create the transformer
NormalizeRevenue = fn_BuildColumnTransformer(RevenueNormSpec)
NormalizeRevenue is now a fully configured function that takes any compatible table and applies all three transformations. Store the spec in a configuration record, and you can version-control your transformation logic as data rather than code.
Let's build something complete. You have sales data arriving from three regions (Americas, EMEA, APAC), each with different currencies, fiscal calendars, and product category hierarchies. You need a unified output table with all regions normalized to USD, using a consistent fiscal period scheme.
Create a query named RegionConfigs with the following let…in expression:
// Query: RegionConfigs
let
AmericasConfig = [
RegionCode = "AMER",
Currency = "USD",
ExchangeRate = 1.0,
FiscalYearStartMonth = 1,
DateColumn = "TransactionDate",
RevenueColumn = "SalesAmountUSD",
TierThresholds = [
MinMarginPct = 0.30,
PremiumThreshold = 0.50,
DiscountCap = 0.25
]
],
EMEAConfig = [
RegionCode = "EMEA",
Currency = "EUR",
ExchangeRate = 1.08,
FiscalYearStartMonth = 4,
DateColumn = "SaleDate",
RevenueColumn = "SalesAmountEUR",
TierThresholds = [
MinMarginPct = 0.28,
PremiumThreshold = 0.45,
DiscountCap = 0.30
]
],
APACConfig = [
RegionCode = "APAC",
Currency = "JPY",
ExchangeRate = 0.0067,
FiscalYearStartMonth = 7,
DateColumn = "TxnDate",
RevenueColumn = "SalesAmountJPY",
TierThresholds = [
MinMarginPct = 0.25,
PremiumThreshold = 0.40,
DiscountCap = 0.35
]
]
in
{AmericasConfig, EMEAConfig, APACConfig}
// Query: fn_NormalizeToUSD
fn_NormalizeToUSD = (regionConfig as record) =>
(sourceTable as table) as table =>
let
revenueCol = regionConfig[RevenueColumn],
rate = regionConfig[ExchangeRate],
withUSD = Table.AddColumn(
sourceTable,
"RevenueUSD",
each Number.Round(Record.Field(_, revenueCol) * rate, 2),
type number
),
withRegion = Table.AddColumn(
withUSD,
"RegionCode",
each regionConfig[RegionCode],
type text
)
in
withRegion
// Query: fn_StandardizeDateColumn
fn_StandardizeDateColumn = (regionConfig as record) =>
(sourceTable as table) as table =>
let
originalCol = regionConfig[DateColumn],
fyStart = regionConfig[FiscalYearStartMonth],
// Rename region-specific date column to standard name
renamed = Table.RenameColumns(
sourceTable,
{{originalCol, "StandardDate"}}
),
// Add fiscal period columns
withFiscal = Table.AddColumn(
renamed,
"FiscalYear",
each
let
m = Date.Month([StandardDate]),
y = Date.Year([StandardDate])
in
if m >= fyStart then y else y - 1,
Int64.Type
),
withFiscalPeriod = Table.AddColumn(
withFiscal,
"FiscalPeriod",
each Number.Mod(Date.Month([StandardDate]) - fyStart + 12, 12) + 1,
Int64.Type
)
in
withFiscalPeriod
// Query: fn_ApplyTierClassification
fn_ApplyTierClassification = (regionConfig as record) =>
(sourceTable as table) as table =>
let
thresholds = regionConfig[TierThresholds],
withMargin = Table.AddColumn(
sourceTable,
"MarginPct",
each
if [RevenueUSD] = 0 then null
else ([RevenueUSD] - [COGSNormalized]) / [RevenueUSD],
type number
),
withTier = Table.AddColumn(
withMargin,
"MarginTier",
each
if [MarginPct] = null then "Undefined"
else if [MarginPct] >= thresholds[PremiumThreshold] then "Premium"
else if [MarginPct] >= thresholds[MinMarginPct] then "Standard"
else "BelowThreshold",
type text
)
in
withTier
// Query: fn_BuildRegionalPipeline
fn_BuildRegionalPipeline = (regionConfig as record) =>
let
// Create fully-bound stage functions for this region
NormalizeRevenue = fn_NormalizeToUSD(regionConfig),
StandardizeDates = fn_StandardizeDateColumn(regionConfig),
ClassifyMargins = fn_ApplyTierClassification(regionConfig),
// The assembled pipeline
Pipeline = (rawTable as table) as table =>
let
stage1 = NormalizeRevenue(rawTable),
stage2 = StandardizeDates(stage1),
stage3 = ClassifyMargins(stage2),
// Final column selection for unified schema
unified = Table.SelectColumns(
stage3,
{
"RegionCode", "StandardDate", "FiscalYear",
"FiscalPeriod", "RevenueUSD", "MarginPct",
"MarginTier", "ProductKey", "StoreID"
}
)
in
unified
in
Pipeline
// Query: Sales_Consolidated
let
// Build region-specific pipelines
AMERPipeline = fn_BuildRegionalPipeline(RegionConfigs{0}),
EMEAPipeline = fn_BuildRegionalPipeline(RegionConfigs{1}),
APACPipeline = fn_BuildRegionalPipeline(RegionConfigs{2}),
// Apply each pipeline to its raw data source
AMER_Processed = AMERPipeline(Sales_AMER_Raw),
EMEA_Processed = EMEAPipeline(Sales_EMEA_Raw),
APAC_Processed = APACPipeline(Sales_APAC_Raw),
// Combine all regions
Combined = Table.Combine({AMER_Processed, EMEA_Processed, APAC_Processed}),
// Final sort
Sorted = Table.Sort(Combined, {{"StandardDate", Order.Ascending}})
in
Sorted
The entire consolidation pipeline — covering three regions with different currencies, fiscal calendars, and margin thresholds — is 15 lines in the final query. The complexity lives in well-tested, composable functions.
Tip
When building multi-region consolidation like this, pair the currying pattern with error handling at each stage. Wrapping stage1, stage2, and stage3 in try...otherwise expressions lets you capture which pipeline stage failed for which region rather than getting a cryptic evaluation error. See Error Handling and Try-Otherwise Patterns in M: Building Production-Ready Power Query Solutions for how to do this without sacrificing readability.
Build a parameterized product catalog cleaning pipeline using currying. Here's your scenario: you receive product data exports from three vendors. Each uses different column names for the same concepts, different text encoding conventions, and different price formats.
Your task: Implement the following using curried functions.
Exercise data — create these as queries:
// VendorAMapping
VendorAMapping = [
ProductIDColumn = "item_code",
ProductNameColumn = "item_description",
PriceColumn = "unit_price_eur",
CategoryColumn = "dept_name",
PriceMultiplier = 1.08 // EUR to USD
]
// VendorBMapping
VendorBMapping = [
ProductIDColumn = "SKU",
ProductNameColumn = "ProductTitle",
PriceColumn = "RetailPriceGBP",
CategoryColumn = "Category",
PriceMultiplier = 1.27 // GBP to USD
]
Build these functions:
fn_RenameToStandardSchema — takes a vendor mapping record and returns a function that takes a table and renames columns to standard names (ProductID, ProductName, PriceUSD, Category).
fn_NormalizePricing — takes a vendor mapping record and returns a function that converts the price column to USD using the PriceMultiplier and rounds to 2 decimal places.
fn_CleanProductText — takes a list of text column names and returns a function that trims whitespace, removes double spaces, and title-cases all specified columns in a table.
fn_BuildVendorPipeline — takes a vendor mapping record and returns a fully composed pipeline function that applies all three transformations in sequence.
Test your pipeline:
// Create this raw data to test with
VendorA_Raw = Table.FromRecords({
[item_code = "A001", item_description = " wireless headphones ", unit_price_eur = 89.99, dept_name = "ELECTRONICS"],
[item_code = "A002", item_description = "USB-C Cable", unit_price_eur = 12.50, dept_name = "ACCESSORIES"],
[item_code = "A003", item_description = "laptop stand", unit_price_eur = 45.00, dept_name = "COMPUTING"]
})
After running your pipeline on VendorA_Raw, the output should have standard column names, prices in USD (multiplied by 1.08, rounded to 2 decimal places), and clean title-cased product names.
This is the most subtle and painful bug in curried M functions. Consider:
// BROKEN: ExchangeRate is captured by reference, not by value
let
ExchangeRate = 1.08,
MakeNormalizer = (sourceTable as table) =>
Table.AddColumn(sourceTable, "USD", each [Revenue] * ExchangeRate),
ExchangeRate = 1.27 // This shadows the previous binding
in
MakeNormalizer
M's let expressions allow shadowing within the same block, and the closure captures the variable name, not the value at the time of creation. The fix is to pass values explicitly as function arguments, which is exactly what currying enforces. If your function takes exchangeRate as number as a parameter, the value is bound at call time and can't be accidentally overwritten.
If you define fn_A = (config) => (table) => ... but fn_B = (table) => (config) => ..., composing them becomes awkward. You'll end up with needless intermediate bindings. Establish a convention across your function library: configuration always comes before data. Stick to it.
Warning
Inconsistent argument ordering across a function library is the currying equivalent of inconsistent column naming in a data model. It seems minor until you're debugging a 6-stage pipeline at 11pm. Pick a convention and document it in a comment at the top of each function.
M won't evaluate a curried function until its result is actually requested. This is usually a feature — it's why lazy evaluation and query folding can combine your curried filters with server-side query execution. But it can bite you during debugging: an error in a curried function's inner body won't surface until the final function in the chain is called with real data.
If you're getting mysterious errors, try invoking each stage explicitly with test data to isolate which stage is failing:
// Debug each stage separately
TestData = Table.FromRecords({[SaleDate = #date(2024,1,15), Revenue = 1000.0, COGS = 650.0]}),
Stage1Result = fn_NormalizeToUSD(EMEAConfig)(TestData),
Stage2Result = fn_StandardizeDateColumn(EMEAConfig)(Stage1Result),
// If Stage2Result errors, the problem is in fn_StandardizeDateColumn
If your data source supports query folding (SQL Server, PostgreSQL, Oracle, etc.), be careful that curried filter functions don't break the fold chain. A Table.SelectRows with an each clause referencing a closed-over record field may prevent folding if M can't translate the expression into a native query predicate.
For folding-critical scenarios, prefer passing literal values rather than record field lookups in your innermost functions. The query folding patterns guide covers exactly when this matters and how to test for it.
Not every function needs to be curried. A helper that converts a text value to title case takes one argument and always will. Forcing it into a curried form because you're "being consistent" adds noise without benefit. Curry when you have a genuine need to partially bind arguments across different call sites. For self-contained utilities, a plain function is cleaner.
Note
A good rule of thumb: if you find yourself always calling the function with all arguments at once and never storing intermediate partially-applied versions, it probably shouldn't be curried. Currying earns its complexity when it enables concrete reuse — not as a stylistic default.
Curried functions in M are, at their core, closures — they capture their surrounding environment. Each partial application creates a new function value that holds references to the bound arguments. For simple scalar arguments (numbers, text, dates), this overhead is negligible. For large tables passed as configuration (like the categoryMapping table in our enrichment example), be mindful.
If a large lookup table is captured in a closure that gets applied to many rows, M may evaluate that table multiple times depending on query structure. The solution is to explicitly buffer it before passing it into the closure:
// Buffer lookup tables before passing them into closures
fn_EnrichCategories(Table.Buffer(CategoryMappingTable))("ProductKey")
This ensures the mapping table is computed once and held in memory, rather than potentially re-evaluated each time the closure is invoked. For more on caching strategies, the Table.Buffer and in-memory caching guide has detailed coverage of when and how to apply this.
For large-scale pipelines, consider building a reusable function library where your curried building blocks are defined once and referenced across multiple reports. This keeps the function definitions out of individual report files and makes performance tuning a single-point-of-change operation.
You've built a complete mental model of function currying in M: what it is, why argument order is an architectural decision, how to compose curried functions into multi-stage pipelines, and how to avoid the most common traps.
The key ideas to carry forward:
From here, the natural progression is toward more advanced compositional patterns. If your pipelines need to handle streaming pagination across API boundaries, the patterns in Streaming and Pagination Patterns in M show how curried iterators handle multi-page sources elegantly. If you're building out a full multi-stage ETL system, Building Multi-Stage ETL Pipelines in Power Query M shows how to orchestrate curried pipelines into a full dependency-managed system. And if you want to enforce schema contracts at each pipeline boundary — a production best practice — Implementing Custom Table.Schema Validation and Type Enforcement Pipelines gives you the tools to make your pipelines fail loudly and informatively when data doesn't match expectations.
Currying isn't a clever trick. It's the natural shape of parameterized, reusable transformation logic in a functional language. Once it clicks, you'll find yourself reaching for it every time you're about to write your third slightly-different copy of the same query.
Advanced M Language