Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
DAX query
Returns a table with information about all variations in the semantic model. This information helps you understand the model.
Syntax
INFO.VARIATIONS([<Restriction name>, <Restriction value>], ...)
Parameters
Parameters are optional for this DAX function. When parameters are used, both must be given. More than one pair of parameters is allowed. The restriction name and value are text and entered in double-quotes.
| Term | Definition |
|---|---|
| Restriction name | Name of the restriction used to filter the results. |
| Restriction value | Value used to filter the results of the restriction. |
Restrictions
Typically, all columns of the DAX function results can be used as a restriction. Additional restrictions may also be allowed.
Return value
A table with the following columns:
| Column | Description |
|---|---|
| [ID] | A reference to the object. IDs are usually autogenerated and should not be changed after the model is created. Data type is unsigned long (4 bytes). |
| [ColumnID] | A reference to the object that owns this variation. |
| [Name] | The name of the variation, used in code, script, and queries. |
| [Description] | The description of the variation. |
| [RelationshipID] | The ID of the relationship on which the variation is defined. |
| [DefaultHierarchyID] | THe ID of the default hierarchy for the variation. |
| [DefaultColumnID] | The ID of the default column for the variation. |
| [IsDefault] | A True or False indicator indicating if the variation is default. |
Remarks
Can only be run by users with write permission on the semantic model and not when live connected to the semantic model in Power BI Desktop. This function can be used in DAX queries, and can't be used in calculations.
Example 1 - DAX query
The following DAX query can be run in DAX query view:
EVALUATE
INFO.VARIATIONS()
This DAX query returns a table with all of the columns of this DAX function.
Example 2 - DAX query with joins
The following DAX query can be run in DAX query view:
EVALUATE
VAR _INFO =
INFO.VARIATIONS()
VAR _ModelColumns =
SELECTCOLUMNS(
INFO.COLUMNS(),
"ColumnID", [ID],
"Column Name", [ExplicitName]
)
VAR _ModelColumns2 =
SELECTCOLUMNS(
INFO.COLUMNS(),
"DefaultColumnID", [ID],
"Default Column Name", [ExplicitName]
)
VAR _ModelRelationships =
SELECTCOLUMNS(
INFO.RELATIONSHIPS(),
"RelationshipID", [ID],
"Relationship Name", [Name]
)
VAR _ModelHierarchies =
SELECTCOLUMNS(
INFO.HIERARCHIES(),
"DefaultHierarchyID", [ID],
"Default Hierarchy Name", [Name]
)
VAR _CombinedTable2 =
NATURALLEFTOUTERJOIN(
_INFO,
_ModelColumns
)
VAR _CombinedTable3 =
NATURALLEFTOUTERJOIN(
_CombinedTable2,
_ModelColumns2
)
VAR _CombinedTable4 =
NATURALLEFTOUTERJOIN(
_CombinedTable3,
_ModelRelationships
)
VAR _CombinedTable5 =
NATURALLEFTOUTERJOIN(
_CombinedTable4,
_ModelHierarchies
)
RETURN
SELECTCOLUMNS(
_CombinedTable5,
"Variation name", [Name],
"Variation description", [Description],
"Column Name", [Column Name],
"Default Column Name", [Default Column Name],
"Relationship Name", [Relationship Name],
"Default Hierarchy Name", [Default Hierarchy Name]
)
ORDER BY [Variation name]
This DAX query returns a table with only the specified columns and joining to other INFO DAX functions and the variations table.