Why DAX Can't Directly Reference Hierarchies in Power BI?
📌 What is a Hierarchy in Power BI?
A hierarchy in Power BI is a structured arrangement of related columns that allows users to drill down from a higher-level category to a more detailed level.
🔹 Example of a Hierarchy
Consider a Date Hierarchy:
- Year → Quarter → Month → Day
Or a Geography Hierarchy:
- Country → State → City
🚫 Why Can’t DAX Refer to a Hierarchy or Hierarchy Level?
DAX can only reference columns, measures, and tables, but not hierarchy objects directly. This is because a hierarchy is a UI feature in Power BI, not an actual data model object.
However, you can reference each level of the hierarchy individually using its column name.
✅ Alternative Approach Using DAX
If you want to calculate something for a specific level in a hierarchy, you must use the underlying column:
🔸 Example: Total Sales by Year (from Date Hierarchy)
TotalSalesByYear = CALCULATE(SUM(Sales[Revenue]), VALUES(Sales[Year]))
This formula references Sales[Year], not the entire hierarchy.
Published on:
Learn moreRelated posts
Using RANK instead of RANKX in DAX
Deprecating Power BI Q&A
We are announcing the deprecation of Q&A, our legacy natural language tool, which will take place in December 2026. Moving forward, users ...
A Look At The Impact Of Calendar Based Time Intelligence On Power BI DirectQuery Performance
Calendar-based time intelligence (see here for the announcement and here for Marco and Alberto’s more in-depth article) is at least the ...
Boost Your Dashboards: The Role of Visual Calculations in Power BI
Visual Calculations in Power BI play a transformative role by allowing users to write calculations directly within a visual, simplifying analy...
Fix ANY Date Format in Excel with Copilot Function – no Power Query – no Macros!
Fix ANY Date Format in Excel with Copilot Function without any Macros. Got dates in multiple, different and difficult formats? No problem. ...
