Trascritto

DAX UDF Parameter Modes: Stop Using VAL and EXPR Wrong

19 nov 2025 · 21 min. 23 sec.
DAX UDF Parameter Modes: Stop Using VAL and EXPR Wrong
Capitoli

01 · The DAX UDF Dilemma

0 sec.

02 · The Context Transition Trap

32 sec.

03 · VAL vs XPR: The Core Decision

47 sec.

04 · The Best Customers Example

1 min. 39 sec.

05 · When to Use VAL and XPR

2 min. 52 sec.

06 · The Context Transition Problem

4 min. 54 sec.

07 · Fixing the Context Transition Trap

5 min. 57 sec.

08 · Materializing with Add Columns

8 min. 59 sec.

09 · Parameter Types and Casting

13 min. 6 sec.

10 · Authoring Checklist for UDFs

16 min. 12 sec.

Descrizione

In this episode of M365.fm, Mirko Peters shows why most DAX user‑defined functions fail quietly — not because the math is wrong, but because parameter modes, context transition, and materialization...

mostra di più
In this episode of M365.fm, Mirko Peters shows why most DAX user‑defined functions fail quietly — not because the math is wrong, but because parameter modes, context transition, and materialization are misunderstood.

WHAT YOU WILL LEARN
  • The real difference between VAL and EXPR: pass‑by‑value vs pass‑by‑expression and why it changes when your logic runs
  • Why using VAL for context‑sensitive metrics freezes results and produces “comfortably wrong” numbers
  • How EXPR behaves like a measure, and why you must wrap it with CALCULATE inside iterators to respect the current row
  • How to stop recomputing expensive expressions by materializing them once with ADDCOLUMNS and reusing the column
  • How data types, coercion, and BLANK handling can quietly change your results in UDFs
  • A practical “Mode → Move → Make” checklist you can apply to every new DAX function you write
THE CORE INSIGHT

DAX UDFs are not magic; they are just DAX with sharper edges. VAL vs EXPR decides whether you pass a frozen scalar or a living expression; context transition decides whether row context becomes filter context; materialization decides whether you pay the same expensive cost hundreds of times or once. If you ignore those three decisions, your UDFs will work in demos and betray you in production.

WHO THIS EPISODE IS FOR

This episode is ideal for Power BI developers, DAX authors, semantic model owners, and anyone building reusable calculation logic in enterprise models. If you’ve ever had a “correct” UDF that fails on slicers, ignores the current row, or suddenly becomes slow at scale, this conversation gives you the mental model and patterns to fix it.

ABOUT THE HOST

Mirko Peters is a Microsoft 365 and data platform consultant focused on building trustworthy, reusable semantic models on Power BI and Microsoft Fabric. Through M365.fm, Mirko shares practical DAX patterns, performance lessons, and modeling approaches that help teams move from fragile measures to robust, well‑behaved UDFs that stand up under real workloads.

Become a supporter of this podcast: https://www.spreaker.com/podcast/m365-fm-a-microsoft-mvp-podcast-by-mirko-peters--6704921/support.
mostra meno
Informazioni
Autore Mirko Peters (M365 Consultant)
Organizzazione m365 FM
Sito www.m365.fm
Tag

Sembra che non tu non abbia alcun episodio attivo

Sfoglia il catalogo di Spreaker per scoprire nuovi contenuti

Corrente

Copertina del podcast

Sembra che non ci sia nessun episodio nella tua coda

Sfoglia il catalogo di Spreaker per scoprire nuovi contenuti

Successivo

Copertina dell'episodio Copertina dell'episodio

Che silenzio che c’è...

È tempo di scoprire nuovi episodi!

Scopri
La tua Libreria
Cerca