How does the CUSTOMDATA function (DAX) work?

The CUSTOMDATA function (DAX) returns the content of the CustomData property in the connection string ().

CUSTOMDATA Formula Syntax


How do you use the CUSTOMDATA function?

This function is commonly used implementing expressions for role based security when an application uses custom authentication.

Related Blog Posts

Related Support Forum Posts

Working With Iterating Functions In DAX
DAX Calculations: Total Of Average Results
Updated Mastering DAX Calculations Course Now Officially Launched

Considerations when using the CUSTOMDATA function

If the custom data flag is not passed in, this will return False; otherwise, it will return True only if the region for the current row equals the one passed in via the connection string.

If you use the Role when viewing a pivot table based upon your model, you’ll see nothing.

One way to edit the connection string used is to choose this ribbon option.

Related Video Tutorials


Formula examples using the CUSTOMDATA function

=IF(CUSTOMDATA()=”OK”, “Correct Custom data in connection string”, “No custom data in connection string property or unexpected value”)

IF ( CUSTOMDATA () = “”, FALSE (), Region[RegionName] = CUSTOMDATA () )

strtoset(“{([People Matter Fee Earner].[BU Login].[BU Login].[“+CustomData()+”])}”)

Related Course Modules



Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.

Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide