Forum Discussion

Benc7777's avatar
Benc7777
Helper I
1 year ago
Solved

View Data in table 2 only when something in table 1 is selected.

Afternoon / Morning all,   I hope somebody can help, so I have done my query in SQL, created table one, now I want to only see data in table 2 when something is select by clicking the line in table...
  • adudani's avatar
    1 year ago

    hi Benc7777 ,

     

     if you want the product orders table to filter the order details:

     

    select the product orders tables

    1. click on "Format"

    2. click on "Edit interactions"

    3. click on "Filter"

     

    this will enable the filtering.

     

    let me know if this is resolved.

     

     

  • johnt75's avatar
    johnt75
    1 year ago

    My mistake, HASONEVALUE was never going to work.Try

    Single Order Selected = IF( COUNTROWS( ALLSELECTED( 'Query1'[Order Number])), 1 )
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Benc7777 ,

     

    I think johnt75's measure is correct in its thinking, but you need to add some comparisons for it to work.

    Please try code as below.

     

    Something is Selected =
    VAR _TotalCount =
        COUNTROWS ( ALL ( 'Query1'[Order Number] ) )
    VAR _SelectCount =
        COUNTROWS ( ALLSELECTED ( 'Query1'[Order Number] ) )
    RETURN
        IF ( _SelectCount >= 1 && _SelectCount < _TotalCount, 1 )

     

    Add this into visual level filter and set it to show items when value =1.

    Result is as below.


     

    Best Regards,
    Rico Zhou

     

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