Forum Discussion
Reference Hierarchy in Measure?
- 4 years ago
I was able to resolve this issue by referring to the columns of the hierarchy without referencing the hierarchy name. Since I only allow a single selection from the hierarchy, I created the measure using a SWITCH statement, starting at the lowest level of the hierarchy. The same approach works with embedded IF statements as long as the first IF statement is the lowest level of the hierarchy.
Thank you amitchandak for your input!!
amitchandak below is a screenshot of my sample data:
When I created the hierarchy, I right-clicked on column 'ONE' and selected "Create hierarchy", named it '123Hierarchy', and added columns 'TWO' and 'THREE' to the hierarchy. Since the hierarchy isn't a column in the 'TEST2' table, it doesn't show up as an option when I start typing the DAX expression:
I was able to resolve this issue by referring to the columns of the hierarchy without referencing the hierarchy name. Since I only allow a single selection from the hierarchy, I created the measure using a SWITCH statement, starting at the lowest level of the hierarchy. The same approach works with embedded IF statements as long as the first IF statement is the lowest level of the hierarchy.
Thank you amitchandak for your input!!