Daily DAX : Day 438 INFO.ROLEMEMBERSHIPS
Power BI DAX Function: INFO.ROLEMEMBERSHIPS
Description
The INFO.ROLEMEMBERSHIPS function is a DAX information function that returns a table listing all role memberships defined in the current data model.
It corresponds directly to the TMSCHEMA_ROLE_MEMBERSHIPS Dynamic Management View (DMV) in tabular models.
The returned table includes columns such as Role ID, Member Name (user or group), and other metadata matching the schema for role memberships.
Syntax
INFO.ROLEMEMBERSHIPS()
No parameters are required.
Key Characteristics
- Returns a table (tabular result).
- Can be used in DAX queries (e.g., in DAX Query View or tools like DAX Studio).
- Cannot be used in calculated tables or calculated columns.
- Requires model admin permissions in Power BI Service (similar to DMVs).
- Performs context transition if called in a row context.
- Its use is not recommended for regular reporting; it's primarily for metadata inspection.
Use Cases
- Model Documentation & Auditing: Retrieve a complete list of users/groups assigned to each security role in the model.
- Metadata Analysis: Query role memberships programmatically (e.g., via scripts or DAX Studio) for governance or compliance checks.
- Development & Troubleshooting: Inspect how Row-Level Security (RLS) roles are configured with members during model development.
- Automation: Combine with other INFO functions (like INFO.ROLES) to export or analyze security configurations across models.
Note: This function returns static role memberships defined in the model (users/groups added in Power BI Service or Desktop). It does not return the active roles for the current user during report viewing. For detecting active roles (useful in reports), alternative techniques exist, such as those described in SQLBI articles using custom measures.
Example Usage (in DAX Query View)
EVALUATE INFO.ROLEMEMBERSHIPS()
This query will return all role memberships in the model.
Comments
Post a Comment