Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Need Help in DAX

 

Five Column Names = ParentID, ChildID, Column3, Column4, Column5
One ParentID can have multiple ChildIDs. 
Two or more  ParentIDs can have common Matching ChildIDs. 
I have created one slicer using ParentID column. I need a DAX to fetch only matching (intersecting) ChildIDs for selected ParentIDs (it could be multiple ParentIDs selection) in slicer

 

Note: We need to have ParentID slicer in the report. Solution should take into account multiple selections in slicer.

 

Scenario 1:

Scenario 2 :

 

 

 

 

2 Replies

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    Hi,

     

    i have something that might work:

     

    Selected = var countselected = calculate(DISTINCTCOUNT('Table (5)'[ParentID]),ALLEXCEPT('Table (5)','Table (5)'[ParentID]))

    var countchildid = calculate(count('Table (5)'[ChildID]))

    Return
    if (countchildid = countselected,1,0)
     

     

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    sorry, also just make sure the selected measure filters the visual to only show value of 1