Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimizes slow DAX measures and queries in semantic models, covering anti-patterns, server timings, and model-level tuning.
45% 95%+50 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 10 of 22 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
How to write the body and signature of a UDF: the parameter type system, evaluation modes, type checks, and patterns. For when a UDF earns its place, naming and documentation, see organize-semantic-model/references/udfs.md.
flowchart LR
call["call site<br/>Fn('Sales'[Amount], 'Date')"] --> mode{parameter mode}
mode -->|VAL| eager["evaluated once<br/>in the caller's filter context"]
mode -->|EXPR| lazy["passed unevaluated<br/>re-evaluated in the function's context"]
eager --> body[function body]
lazy --> body
DEFINE
/// Adds tax to an amount
FUNCTION Finance.AddTax = ( amount : NUMERIC, rate : DOUBLE ) =>
amount * ( 1 + rate )
In TMDL the same function is a function object, written to definition/functions.tmdl:
createOrReplace
function Finance.AddTax = ( amount : NUMERIC, rate : DOUBLE ) => amount * ( 1 + rate )
A parameter is name : [TYPE] [SUBTYPE] [MODE]. Every part is optional; a bare name is ANYVAL VAL.
types:
value types (evaluated before the call):
ANYVAL: scalar or table, the default
SCALAR: scalar only
TABLE: table only
expression types (always EXPR mode):
ANYREF: any reference
COLUMNREF, TABLEREF, MEASUREREF, CALENDARREF: a reference of that kind
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.