Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
dvdjwt
New Member

Creating a measure to dynamically select hierarchy used

I have two hierarchies in one of my tables. Table1[ProjH] and Table1[PriorityH].

ProjH contains three fields that are also in Table1; Portfolio, Programme and Project.

PriorityH contains two fields from Table1; Priority and Outcome. 

The two hierarchies work as expected and we can drill up and down in visuals.

I have two visuals that are almost identical. Simple column chart using Forecast as a measure on Y axis, with either ProjH or PriorityH on the X axis.

I have been exploring using measures based on switch function to replace the measure used based on a selection of a slicer, which works well, but cannot seem to achieve the same result for the hierarchy in X axis.

Essentially I am wanting to have a slicer which could either select Project or Priority, with a measure based on that which represents the corresponding hierarchy. The plan being to use that measure in my visual and be able to toggle hierarchy used within the display.

Don't seem to be able to reference the hierarchy itself within the DAX to return  it. Looked into using parameters too, but again, I can use any other dimensions from Table1 but it will not allow me to drag the hierarchy in.

Has anyone achieved this?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey  @dvdjwt ,

 

I recommend to read these articles to get you familiar with data modeling:

From my understanding your can switch between the hierarchies by leveraging the Field Parameters function:

Hopefully this will help to tackle your challenge.

 

Regards,

Tom
 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey  @dvdjwt ,

 

I recommend to read these articles to get you familiar with data modeling:

From my understanding your can switch between the hierarchies by leveraging the Field Parameters function:

Hopefully this will help to tackle your challenge.

 

Regards,

Tom
 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.