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
Why Stored Procedures Break in Power BI DirectQuery
Automating Power BI Load Testing with Fabric Notebooks – Part 1: Capturing Real Queries
Load testing is essential when working with Microsoft Fabric capacity. With limited resources, deploying a Power BI report without testing can...
Introducing Improvements to the Report Copilot in Power BI
We’ve upgraded the Report Copilot experience in Power BI, making it easier than ever to create, edit, and refine beautiful, data-rich re...
Power BI October 2025 Feature Summary
This month’s update brings exciting opportunities for learning and community engagement, including the upcoming Fabric Skills Fest and t...
