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

INFO.ATTRIBUTEHIERARCHIES ( [<RestrictionName> [, [<RestrictionValue>] [, <RestrictionName> [, [<RestrictionValue>] [, … ] ] ] ] ] )
Parameter Attributes Description
RestrictionName Optional
Repeatable

Restriction name.

RestrictionValue Optional
Repeatable

Restriction value.

Return values

Table An entire table or a table with one or more columns.

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

2018-2026 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Passed by Expression

This parameter is passed by expression and can be evaluated multiple times in different evaluation contexts.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of INFO.ATTRIBUTEHIERARCHIES? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.