Forum Discussion

stefantaust's avatar
stefantaust
Helper I
1 year ago
Solved

Filter with value from another table

Hello, I have a problem with a filter. There are two tables that aren't linked. Table 1 has a slice, and only one value remains. I want to filter Table 2 to this value from Table 1.  Show me all val...
  • Nasif_Azam's avatar
    1 year ago

    Hey stefantaust ,

    Hi Stefan! You’re on the right track by wanting to filter one table based on a value from another. Since your tables aren't related and you want to apply a dynamic filter, here's how to solve it depending on the tool you're using. Below are approaches for Power BI and DAX, which is a common scenario for this type of problem.

    Problem Summary

    You have:

    • Table 1 with a slicer applied → only 1 value remains (e.g., a threshold).

    • Table 2 that you want to filter dynamically to show rows where value <= threshold from Table 1.

    • There is no relationship between Table 1 and Table 2.

    Solution Using DAX (Disconnected Tables)

    1. Create a Measure to Extract the Slicer Value

      SelectedValueFromTable1 = SELECTEDVALUE('Table1'[YourColumn])
    2. Create a Measure to Filter Table 2
      You cannot directly filter a table visual using a column expression like that, but you can use a measure to achieve it.

      ShowValue = 
      VAR threshold = [SelectedValueFromTable1]
      RETURN
          IF(MAX('Table2'[YourValueColumn]) <= threshold, 1, 0)
    3. Apply Visual-Level Filter

      • Add the ShowValue measure to your visual.

      • Set a filter on it: ShowValue = 1.

    This will dynamically show only the rows in Table 2 where values are less than or equal to the selected slicer value from Table 1.

    When Using Power Query

    If you are in Power Query (instead of visuals or measures), it’s trickier because dynamic interaction via slicers isn’t available. You'd need to:

    • Pull the selected value into a parameter.

    • Reference that parameter to filter the other table. But this won’t be interactive like slicers in reports.

     

    If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


    Best Regards,
    Nasif Azam