Forum Discussion

8a5c4b91-8100-4's avatar
8a5c4b91-8100-4
Regular Visitor
3 years ago
Solved

Filter on selected leaf node

Hi,   I have a table with 2 columns: source and target. Sample:   Source Target Company Plant A Company Plant B Company Plant C Plant A Building X Plant A Building Y P...
  • v-yalanwu-msft's avatar
    3 years ago

    Hi, 8a5c4b91-8100-4 ;

    You could create a flag measure.

    flag = 
    IF(CONTAINSSTRING(
    CALCULATE(MAX('FullHierarchy'[P]),FILTER(ALL(FullHierarchy),PATHCONTAINS([P],MAX('Leafs'[LeafNode])))),
    MAX('FullHierarchy'[Target])),1)

    Then filter it .

    The final result:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.