|
| 1 | +--- |
| 2 | +description: "Learn more about: INFO.ALTERNATEOFDEFINITIONS" |
| 3 | +title: "INFO.ALTERNATEOFDEFINITIONS function (DAX)" |
| 4 | +author: jeroenterheerdt |
| 5 | +--- |
| 6 | +# INFO.ALTERNATEOFDEFINITIONS |
| 7 | + |
| 8 | +[!INCLUDE[applies-to-query-only](includes/applies-to-query-only.md)] |
| 9 | + |
| 10 | +Returns a table with information about each alternate of definition in the semantic model. This function provides metadata about alternate definitions for model objects. |
| 11 | + |
| 12 | +## Syntax |
| 13 | + |
| 14 | +```dax |
| 15 | +INFO.ALTERNATEOFDEFINITIONS ( [<Restriction name>, <Restriction value>], ... ) |
| 16 | +``` |
| 17 | + |
| 18 | +[!INCLUDE[parameters-for-info-dax-functions](includes/parameters-for-info-dax-functions.md)] |
| 19 | + |
| 20 | +## Return value |
| 21 | + |
| 22 | +A table whose columns match the schema rowset for alternate of definitions in the current semantic model. |
| 23 | + |
| 24 | +| Column | Description | |
| 25 | +|---|---| |
| 26 | +| [ID] | Unique identifier for the alternate of definition object. | |
| 27 | +| [ColumnID] | Reference to the column object that has an alternate definition. | |
| 28 | +| [BaseColumnID] | Reference to the base column that this alternate definition is derived from. | |
| 29 | +| [BaseTableID] | Reference to the base table containing the base column. | |
| 30 | +| [Summarization] | The summarization method applied to the alternate definition (e.g., Sum, Count, Average). | |
| 31 | + |
| 32 | +## Remarks |
| 33 | + |
| 34 | +* Can only be ran by users with write permission on the semantic model and not when live connected to the semantic model in Power BI Desktop. |
| 35 | +* This function can be used in [DAX queries](/dax/dax-queries), and can't be used in calculations. |
| 36 | + |
| 37 | +## Example 1 - DAX query |
| 38 | + |
| 39 | +The following DAX query can be run in [DAX query view](/power-bi/transform-model/dax-query-view): |
| 40 | + |
| 41 | +```dax |
| 42 | +EVALUATE |
| 43 | + INFO.ALTERNATEOFDEFINITIONS() |
| 44 | +``` |
| 45 | + |
| 46 | +## Example 2 - DAX query with joins |
| 47 | + |
| 48 | +The following DAX query can be run in [DAX query view](/power-bi/transform-model/dax-query-view): |
| 49 | + |
| 50 | +```dax |
| 51 | +EVALUATE |
| 52 | + VAR _AlternateOfDefinitions = |
| 53 | + INFO.ALTERNATEOFDEFINITIONS() |
| 54 | +
|
| 55 | + VAR _Columns = |
| 56 | + SELECTCOLUMNS( |
| 57 | + INFO.COLUMNS(), |
| 58 | + "ColumnID", [ID], |
| 59 | + "Column Name", [ExplicitName], |
| 60 | + "TableID", [TableID] |
| 61 | + ) |
| 62 | +
|
| 63 | + VAR _BaseColumns = |
| 64 | + SELECTCOLUMNS( |
| 65 | + INFO.COLUMNS(), |
| 66 | + "BaseColumnID", [ID], |
| 67 | + "Base Column Name", [ExplicitName] |
| 68 | + ) |
| 69 | +
|
| 70 | + VAR _BaseTables = |
| 71 | + SELECTCOLUMNS( |
| 72 | + INFO.TABLES(), |
| 73 | + "BaseTableID", [ID], |
| 74 | + "Base Table Name", [Name] |
| 75 | + ) |
| 76 | +
|
| 77 | + VAR _CombinedWithColumns = |
| 78 | + NATURALLEFTOUTERJOIN( |
| 79 | + _AlternateOfDefinitions, |
| 80 | + _Columns |
| 81 | + ) |
| 82 | +
|
| 83 | + VAR _CombinedWithBaseColumns = |
| 84 | + NATURALLEFTOUTERJOIN( |
| 85 | + _CombinedWithColumns, |
| 86 | + _BaseColumns |
| 87 | + ) |
| 88 | +
|
| 89 | + VAR _CombinedWithBaseTables = |
| 90 | + NATURALLEFTOUTERJOIN( |
| 91 | + _CombinedWithBaseColumns, |
| 92 | + _BaseTables |
| 93 | + ) |
| 94 | +
|
| 95 | + RETURN |
| 96 | + SELECTCOLUMNS( |
| 97 | + _CombinedWithBaseTables, |
| 98 | + "Column Name", [Column Name], |
| 99 | + "Base Table Name", [Base Table Name], |
| 100 | + "Base Column Name", [Base Column Name], |
| 101 | + "Summarization", [Summarization] |
| 102 | + ) |
| 103 | + ORDER BY [Column Name] |
| 104 | +``` |
| 105 | +## See also |
| 106 | + |
| 107 | +[INFO.TABLES](info-tables-function-dax.md) |
| 108 | +[INFO.COLUMNS](info-columns-function-dax.md) |
| 109 | +[INFO.MEASURES](info-measures-function-dax.md) |
| 110 | +[INFO functions overview](info-functions-dax.md) |
0 commit comments