Forum Discussion
Detecting hierarchies in matrix table
Hello, guys!
Need some help.
Try to create some measures for calculation in table, but got some errors with hierchy.
I googled a little and found this article:
https://www.daxpatterns.com/hierarchies/
I tried to repeat The Product Level measure, but it didn`t work correctly.
Look,
What did i wrong?
Link to pbix: https://drive.google.com/file/d/18RSdNrmt79EE36iY_i75RfjiyMgjh9Tu/view?usp=sharing
@KonstantinD
You must change column1 and 2 in the variables, try the following measure:Product Level 2 = VAR IsProductInScope = ISINSCOPE ( 'Table'[Column2] ) VAR IsSubcatInScope = ISINSCOPE ( 'Table'[Column1] ) VAR Result = SWITCH ( TRUE (), IsProductInScope, "Product", IsSubcatInScope, "Subcategory", "No filter" ) RETURN Result___________________
If my answer was helpful, click OK as the solution to help other members find it useful
Click the Thumbs-Up icon if you like this answer 🙂
3 Replies
- Fowmy
Super User
@KonstantinD
You must change column1 and 2 in the variables, try the following measure:Product Level 2 = VAR IsProductInScope = ISINSCOPE ( 'Table'[Column2] ) VAR IsSubcatInScope = ISINSCOPE ( 'Table'[Column1] ) VAR Result = SWITCH ( TRUE (), IsProductInScope, "Product", IsSubcatInScope, "Subcategory", "No filter" ) RETURN Result___________________
If my answer was helpful, click OK as the solution to help other members find it useful
Click the Thumbs-Up icon if you like this answer 🙂
- AnonymousNot applicable
- Fowmy
Super User
Anonymous
You are welcome,kindly accept the reply as the solution if it is helpful for you,
Thanks