DAX function
CUSTOMDATA — DAX function reference
Read a value passed in the connection.
Syntax
dax
CUSTOMDATA()
Examples
dax
CUSTOMDATA()
→ A string
dax
LOOKUPVALUE(Tenant[Region], Tenant[TenantID], CUSTOMDATA())
→ Looks up a region using a tenant ID passed in via the connection string, for embedded multi-tenant RLS
dax
IF(ISBLANK(CUSTOMDATA()), "No custom data passed", CUSTOMDATA())
→ Guards against a report opened without the CustomData connection parameter set
Common mistakes & gotchas
- CUSTOMDATA() only returns a value when the client connection explicitly sets it (e.g., via the CustomData property in a Power BI Embedded token or an SSAS connection string) — in normal Power BI Desktop/Service browsing with no embedding setup, it returns blank.
- It returns a single raw string, not a structured value — passing multiple pieces of context (tenant ID and region, say) requires encoding/decoding a delimited string yourself, since CUSTOMDATA() has no built-in structure.
Related DAX functions
From Security & context info