Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

interation between 2 visual to filter data

Hi Guys,

I got 2 table visual from 2 different tables. I'm trying to filter 1st visual(master) (on click) to filter 2nd visual(child). And i want to click on 2nd visual returned rows without impacting 1st visual selection. In both tables i got "ID" common key. i am applying the below measure on child visual in filter (Control_child_table =1)

 

 

control_child_table = 
VAR _id = SELECTEDVALUE('contact_master'[id]) 
VAR _fil_id = FILTER('contact_child', 'contact_child'[id] = _id) 
VAR _condition = if(COUNTROWS(_fil_id)=1,1,0)
Return
IF(_condition =1,1,0)

 

 

 When i click on 1st visual row its filtering child table view properly but as soon as i click on child view row my child view go blank. I believe i applied Interation properly, parent visual to child visual filter is on and 'None' from Child visual to Parent. Please guide why my child visual resetting to blank when i click on it. I'm using this PowerBI Desktop version(Version: 2.140.1078.0 64-bit (February 2025)

16 Replies

  • Hi Anonymous Could you try with MAX function and check i am attaching a sample

    Control_child_table = 
    VAR _id = SELECTEDVALUE('contact_master'[id]) 
    RETURN
    IF(
        NOT(ISBLANK(_id)) && MAX('contact_child'[id]) = _id,
        1,
        0
    )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Akash, i tried this dax in measure and applied filter on 2nd visual but as soon as i click on child visual data it goes blank. Thanks for you suggestion.

      • Akash_Varuna's avatar
        Akash_Varuna
        Super User

        Hi Anonymous Is the interactions enabled ? Like bewteen Parent and Child enabled and Child to Parent Disabled like kept to None ?

  • Anonymous Hello Mel,
    Can you please try below measure?

    control_child_table =
    VAR _id = SELECTEDVALUE('contact_master'[id])
    VAR _fil_id = FILTER('contact_child', 'contact_child'[id] = _id)
    VAR _condition = IF(COUNTROWS(_fil_id) > 0, 1, 0) 
    RETURN IF(_condition = 1, 1, 0)


    Thanks
    Harish M
    Did I answer your question? Mark my post as a solution! Appreciate your Kudos

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Harish, thanks for you reply i tried this dax on child visual but when i click on child filtered rows it reset and show all the records. i'm using below relation in tables. thanks