INFO.ATTRIBUTEHIERARCHIES DAX Function (Information)
Returns a list of all attribute hierarchies in the current model with columns matching the schema rowset for attribute hierarchy objects.
Syntax
| Parameter | Attributes | Description |
|---|---|---|
| RestrictionName | Optional Repeatable |
Restriction name. |
| RestrictionValue | Optional Repeatable |
Restriction value. |
Return values
A table with one row for each attribute hierarchy in the model. The columns match the TMSCHEMA_ATTRIBUTE_HIERARCHIES DMV.
| Field | Type |
|---|---|
| ID | Integer |
| ColumnID | Integer |
| State | Integer |
| AttributeHierarchyStorageID | Integer |
| ModifiedTime | DateTime |
| RefreshedTime | DateTime |
Remarks
Corresponds to the TMSCHEMA_ATTRIBUTE_HIERARCHIES data management view (DMV).
As all the INFO functions, it cannot be used in calculated tables and calculated columns.
Use this function in a DAX query. Without arguments, the function returns all the rows. To filter the rows, pass pairs of arguments: the name of a restriction and its value, both as text. If you use more than one pair, a row must match all of them. The number of arguments must be even, and an unknown restriction name returns an error. The restriction name is not case sensitive. The restriction name is the name of a column in the result. For example, INFO.ATTRIBUTEHIERARCHIES ( “ColumnID”, “40” ) returns the attribute hierarchy of one column.
The engine creates one attribute hierarchy for each column, so the result has one row for each column of the model. ColumnID is the ID of the column in INFO.COLUMNS. AttributeHierarchyStorageID is the ID of the matching row in INFO.ATTRIBUTEHIERARCHYSTORAGES. State is 1 when the attribute hierarchy is ready to be queried. In the test model, all rows have State 1. ModifiedTime and RefreshedTime show the last change and the last refresh. To get the column name, join the result to INFO.COLUMNS, as in the example.
According to Microsoft documentation, only users with write permission on the semantic model can run this function, and it does not work in a live connection to a model in Power BI Desktop.
Examples
-- Each column has one attribute hierarchy. The query shows five columns with their table name.
EVALUATE
VAR ColumnList =
SELECTCOLUMNS (
FILTER ( INFO.COLUMNS (), NOT [IsHidden] && NOT ISBLANK ( [ExplicitName] ) ),
"ColumnID", [ID],
"TableID", [TableID],
"Column", [ExplicitName]
)
VAR TableList =
SELECTCOLUMNS ( INFO.TABLES (), "TableID", [ID], "Table", [Name] )
VAR Result =
SELECTCOLUMNS (
NATURALINNERJOIN (
NATURALINNERJOIN ( INFO.ATTRIBUTEHIERARCHIES (), ColumnList ),
TableList
),
"Table", [Table],
"Column", [Column],
"State", [State],
"Refreshed", [RefreshedTime]
)
RETURN
TOPN ( 5, Result, [Table], ASC, [Column], ASC )
ORDER BY [Table], [Column]
| Table | Column | State | Refreshed |
|---|---|---|---|
| Account | AccountKey | 1 | 2021-01-05 15:36:55.043 |
| Account | AccountName | 1 | 2021-01-05 15:36:55.047 |
| Account | ParentAccountKey | 1 | 2021-01-05 15:36:55.047 |
| Customer | Address Line 1 | 1 | 2020-10-28 09:32:17.16 |
| Customer | Address Line 2 | 1 | 2020-10-28 09:32:17.153 |
Last update: Nov 27, 2026 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://learn.microsoft.com/en-us/dax/info-attributehierarchies-function-dax