Forum Discussion
Using measures to filter another table
- Anonymous2 years ago
Hi mattcha ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table and a measure.
Table 2 = 'Table'Flag = var _position=CALCULATE(MAX('Table'[position]),ALLSELECTED('Table')) var _age=CALCULATE(MAX('Table'[age]),ALLSELECTED('Table')) var _season=CALCULATE(MAX('Table'[season]),ALLSELECTED('Table')) return IF(AND(AND(MAX('Table 2'[position])=_position ,MAX('Table 2'[season])=_season),OR(MAX('Table 2'[age])=_age+1,MAX('Table 2'[age])=_age-1)),1,0)(3) Place [Flag=1] on the visual object filter and then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous and others, to give you a bit more context, here is some sample data from table "stats":
Using the slicer "name" on Player I, that is what I'd have in my first part of the dashboard.
Then, I'd like to use some of the data from this player as a filter to look for similar profiles:
-same position
-+/- 1 year difference
-data from the latest season
In the example of Player I the second tab should show me that:
| name | season | age | position | score | goals |
| Player G | 2023/2024 | 20 (+1 year from player I) | Forward | 45 (closest score from player I) | 5 |
| Player H | 2023/2024 | 18 (-1 year from player I) | Forward | 37 | 3 |