Loading...

Why DAX Can't Directly Reference Hierarchies in Power BI?

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 more
Power Platform , D365 CE & Cloud
Power Platform , D365 CE & Cloud

Dynamics 365 CE, Power Apps, Powerapps, Azure, Dataverse, D365,Power Platforms (Power Apps, Power Automate, Virtual Agent and AI Builder), Book Review

Share post:

Related posts

Power BI, M365 Copilot And The Importance Of DAX UDFs

This was a big week for Power BI Copilot with the announcement of a new direction for the feature. If you haven’t done so already, read ...

4 days ago

Microsoft Copilot (Microsoft 365): Power BI integration in M365 Copilot

This release enables M365 Copilot to reason over Power BI enterprise data and returns grounded answers directly from Power BI reports and sema...

10 days ago

Using Fabric Operations Agents And Workspace Monitoring With Power BI

This week, in the announcement about support for Fabric Pipelines in Workspace Monitoring, I noticed that it came with an Operations Agent tha...

11 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy