Forum Discussion
Filter with value from another table
- 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)
Create a Measure to Extract the Slicer Value
SelectedValueFromTable1 = SELECTEDVALUE('Table1'[YourColumn])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)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
Hello stefantaust
Try this
Step-by-Step Solution
Table1 has a slicer on [SelectedValue] (only one value selected).
Table2 has a column [TargetValue] you want to filter based on the slicer value.
Create a measure like this
SelectedValueFromTable1 =
MAX(Table1[SelectedValue])
Then, create a second measure for filtering Table2:
ShowFlag =
VAR SelectedVal = MAX(Table1[SelectedValue])
RETURN
IF(MAX(Table2[TargetValue]) <= SelectedVal, 1, 0)
Now, apply a visual-level filter (on your Table2 visual) using ShowFlag:
Filter: ShowFlag = 1
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.