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
Monthly Power BI Semantic Model Refreshes With Fabric Data Pipelines
I’m sure you already know how to configure scheduled refresh for your semantic models in Power BI. While the options you have for contro...
Highlight the chosen period in Power BI charts
Top N Analysis in Power BI: Uncover Key Insights Instantly !
π What is Top N Analysis in Power BI? Top N Analysis in Power BI is a technique used to display the top βNβ values from a dataset based...
Power BI Demo - Quick Actions with Copilot
Power BI Demo - Azure Maps are Where?
Power BI Demo - Visual Calculations Magic
Power BI Demo - How did Copilot do that?
Power BI Update - February 2025
Power BI February 2025 Feature Summary
Welcome to the February 2025 update! Welcome to our latest blog post, where we are thrilled to introduce some game-changing features for Po...