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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.