Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Child and parent filter

My requirement is I have Main table that is below and Imported into Power BI made table visual and taken Child field as a slicer and when choose any Child filed please see My requirement

Main table

ChildParent
AAA1
BBB1
CCC1
AAA2
DDD2
FFF2
BBB3
CCC3
DDD3
FFF3
AAA4
FFF4
GGG4
SSS4

 

My requirement

If i select AAA then display like

ChildParent
AAA1
BBB1
CCC1
AAA2
DDD2
FFF2
AAA4
FFF4
GGG4
SSS4

 

 

Please help me on this

thank you in advance 

 

  • Anonymous 

    You can achieve this by creating a separate disconnected table for the Child column.

    You can download the file: HERE

     

    Measure = 
    
    var __childselected = SELECTEDVALUE('Child Table'[Child])
    var __table = 
        CALCULATETABLE( 
            'Main Table',
            'Main Table'[Child] = __childselected 
        )
    return
    ISEMPTY(__table) * 1

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

     

     

6 Replies

  • Anonymous 

    You can achieve this by creating a separate disconnected table for the Child column.

    You can download the file: HERE

     

    Measure = 
    
    var __childselected = SELECTEDVALUE('Child Table'[Child])
    var __table = 
        CALCULATETABLE( 
            'Main Table',
            'Main Table'[Child] = __childselected 
        )
    return
    ISEMPTY(__table) * 1

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Working great Thank you Fowmy 

    • Krista's avatar
      Krista
      Frequent Visitor

      Fowmy -- I've run into this same issue and I think your solution will work, but I can't access the file you linked to. I've created the separate table and measure, but I'm not sure where to go from there. Which table is the measure supposed to be created in? From which table do I use the Child field for the slicer?

       

      Thanks!!

  • AntrikshSharma's avatar
    AntrikshSharma
    Icon for Community Champion rankCommunity Champion

    Anonymous I am not being rude, but you haven't even written a single full sentence, how would someone understand what you are trying to achieve? 🙂

    • Anonymous's avatar
      Anonymous
      Not applicable

      AntrikshSharma 

       

      Sorry for that just now updated with clear note 

      Thank you ðŸ™‚

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    When I select CCC

     

    ChildParent
    AAA1
    BBB1
    CCC1
    BBB3
    CCC3
    DDD3
    FFF3