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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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,ssdfsdff.PNG

What did i wrong? 

 

Link to pbix: https://drive.google.com/file/d/18RSdNrmt79EE36iY_i75RfjiyMgjh9Tu/view?usp=sharing

1 ACCEPTED SOLUTION
Fowmy
Super User
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

Fowmy_0-1607284578308.png

___________________

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 🙂


Website Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Many thanks @Fowmy !

It depends on sequence of erarchy level in measure - got it!

@Anonymous 


You are welcome,

 

kindly accept the reply as the solution if it is helpful for you,

Thanks

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
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

Fowmy_0-1607284578308.png

___________________

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 🙂


Website Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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