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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vidhyasankar
Frequent Visitor

Power BI DAX Filter Matrix/Table Based on Slicer Hierarchy Level

I've a parent / child slicer and would like to apply an extra filter when a child value is selected.  I want to use the native slicer and build a hierachy with Business as parent and Product as child.

 

BusinessProductRelationTeamFilter Column
HRHr1DedicatedAInclude
HRHr1GenericBExclude
MarketingMkt1DedicatedCInclude
MarketingMkt1GenericDExclude
MarketingMkt2GenericEExclude
MarketingMkt2DedicatedFInclude

 

When a parent is selected in the hierachy, eg. "Marketing", I'd like to show all 4 teams C, D, E & F.  However, when a child hierachy value is selected, eg. Mkt1, then I want to exclude the Generic relation rows in the table or matrix.  The reason is Generic teams support entire Business and should be shown only at business level, where as dedicated teams are only for specific products.

 

Expected output when Marketing is selected at parent level

 

BusinessProductRelationTeam
MarketingMkt1DedicatedC
MarketingMkt1GenericD
MarketingMkt2GenericE
MarketingMkt2DedicatedF

 

Expected output when Mkt1 is selected under Marketing (should exclude Gneric Relation Team)

BusinessProductRelationTeam
MarketingMkt1DedicatedC

 

Is this scenario possible?

 

I tried creating a Measure using ISFILTERED to get the level of hierarchy but couldn't figure out a way to use that as a filter inside table.

 

Thanks a lot!

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@vidhyasankar 

My suggest is just include the filter column in the Hierarchy. Otherwise you may need to create a distinct table with a few measures making measures to filter to the selected slicer.

Hierarchy.PNG

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@vidhyasankar 

My suggest is just include the filter column in the Hierarchy. Otherwise you may need to create a distinct table with a few measures making measures to filter to the selected slicer.

Hierarchy.PNG

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

samdthompson
Memorable Member
Memorable Member

Hello, heres a really good explanation of creating the heirarchy you need:

 

https://www.daxpatterns.com/parent-child-hierarchies/

 

// if this is a solution please mark as such. Kudos always appreciated.

Thanks a lot for the response!  The link shows calculation of measures based on parent / child hierarchy.  In my requirement there are no numerical values.  Just apply extra filter to exclude cetrain rows if a child member is selected.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.