Forum Discussion

kentchiu's avatar
kentchiu
Regular Visitor
1 year ago
Solved

How to setup a visual for a table with only a selected record from another visual data

Hi, I need some help setting up a visual that only shows the record/data referenced in a different Visual on the same page.   Table 1 (Versions):  RP Ticket, Release name, DAY, ... Table 2 (Issue...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from amustafa , please allow me to provide another insight:

    Hi, kentchiu 

    Regarding the issue you raised, my solution is as follows:

    1.Firstly, I created the following sample data and established a relationship between the two tables:


    This is the current page, with the upper section referred to as visual1 and the lower section as visual2.

    2.Secondly, I created the following measures:

    MEASURE = 
    IF (
        MAX ( 'visual2'[RElEASE NAME] ) IN VALUES ( 'VISUAL'[RElEASE NAME] ),
        1,
        0
    )
    

    3.Next, I applied the measures to visual2:

    4.Finally, here are the results, which I hope will meet your needs:

    This is the outcome when visual1 has not been selected:

     

    This shows the result when one row from visual1 is selected:

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, kentchiu 
     

    Thank you for your prompt response and for accepting my answer as a solution. I appreciate the recognition.

     

    Here’s a further explanation of my solution:

    1.Firstly, our approach primarily revolves around the application of measures and filters. In the measures, we first utilise the VALUES() function to extract the 'RELEASE NAME' column from your visualisation as a virtual table (which you might also consider as a virtual column).

    VALUES function (DAX) - DAX | Microsoft Learn

    2.Secondly, we employ the MAX() function to retrieve the current row value, allowing us to compare the 'RELEASE NAME' column in Visual 2 with that in Visual 1, thereby returning either 1 or 0.

    MAX function (DAX) - DAX | Microsoft Learn

     

    3.Finally, we achieve this using a visual-level filter.

    Add a filter to a report in Power BI - Power BI | Microsoft Learn

     

    4.For more details, please refer to:

    Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn

    https://learn.microsoft.com/en-us/dax/dax-operator-reference#logical-operators

     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.