Dax Function: INFO.VIEW.RELATIONSHIPS
Category: INFO Functions
The INFO.VIEW.RELATIONSHIPS function in Power BI is a DAX (Data Analysis Expressions) function designed to retrieve metadata about relationships between tables in a data model. It allows users to analyze and document relationships, including their cardinality, direction, and active status.
Purpose
The purpose of the INFO.VIEW.RELATIONSHIPS function is to enable users to explore, validate, and manage relationships within a data model. This is crucial for maintaining the integrity of data models and ensuring correct query behavior.
Type of Calculations it Performs
Provides metadata about relationships, including the tables and columns involved.
Retrieves relationship attributes such as cardinality, direction, and active/inactive status.
Performs non-calculative operations focused on model inspection.
Practical Use Cases
Model Validation: Verify relationships in a complex data model to avoid errors in report generation.
Schema Documentation: Automatically generate relationship diagrams or documentation for data models.
Debugging: Identify and resolve issues caused by inactive or incorrectly configured relationships.
Dynamic Analysis: Build reports or visuals that adapt based on relationship metadata.
INFO.VIEW.RELATIONSHIPS()
| Parameter | Type | Description |
|---|---|---|
| None | – | This function does not require any parameters. |
How Does INFO.VIEW.RELATIONSHIPS Dax Works
Model Inspection: The function scans the data model to retrieve all relationships defined between tables.
Metadata Retrieval: It collects key properties for each relationship, such as cardinality and direction.
Tabular Output: Returns a table that can be used for analysis or documentation purposes.
Example Formula
Retrieve all relationships in the current data model:
INFO.VIEW.RELATIONSHIPS()What Does It Return?
The function returns a table with metadata about the relationships in the data model. The table includes the following columns:
Relationship Name: The name of the relationship.
Table 1: The first table in the relationship.
Column 1: The column from the first table.
Table 2: The second table in the relationship.
Column 2: The column from the second table.
Cardinality: Describes the cardinality (e.g., one-to-one, one-to-many).
Direction: Indicates the direction of the relationship.
Active: A boolean value indicating if the relationship is active.
When Should We Use It?
To document relationships for presentations or audits.
During model debugging to check for inactive relationships.
In dynamic report designs to adapt based on relationship configurations.
Examples
Basic Usage :
Retrieve all relationships in the data model:
INFO.VIEW.RELATIONSHIPS()
Example output:
| Relationship Name | Table 1 | Column 1 | Table 2 | Column 2 | Cardinality | Direction | Active |
| Sales_Customer | Sales | CustomerID | Customers | CustomerID | One-to-Many | Single | True |
Column Usage
Extract only the active relationships:
FILTER(INFO.VIEW.RELATIONSHIPS(), [Active] = TRUE)
Advanced Usage
Combine with other functions to analyze relationships dynamically:
SUMMARIZE(INFO.VIEW.RELATIONSHIPS(), [Cardinality], COUNT([Relationship Name]))
This calculates the count of relationships for each cardinality type.
Tips and Tricks
Filter Inactive Relationships: Use filters to focus on active or inactive relationships as needed.
Combine with Visuals: Pair with visuals to create dynamic diagrams of relationships in the data model.
Validate Complex Models: Useful for analyzing models with a large number of interconnected tables.
Potential Pitfalls
May return a large table for complex models, which can impact performance.
Does not provide details about relationship roles (e.g., primary/foreign key role specifics).
Performance Impact of INFO.VIEW.RELATIONSHIPS DAX Function:
Efficient for small to medium-sized models.
For larger models, consider filtering results to focus on specific tables or attributes.
Related Functions You Might Need
INFO.VIEW.TABLES: Retrieves metadata about tables in the model.
INFO.VIEW.COLUMNS: Provides metadata about columns in a table.
USERELATIONSHIP: Used to activate inactive relationships in calculations.
Want to Learn More?
For more information, check out the official Microsoft documentation for INFO.VIEW.RELATIIONSHIPS You can also experiment with this function in your Power BI reports to explore its capabilities.
Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.
It retrieves metadata about relationships between tables in a Power BI data model.
Yes, you can use DAX functions like FILTER to narrow down the results.
Attributes include relationship name, table names, columns, cardinality, direction, and active status.
The output includes both active and inactive relationships, with a boolean column indicating the status.
It works with tabular models supported in Power BI but may not be compatible with all external data sources.