Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
mattcha
Regular Visitor

Using measures to filter another table

Hi everyone! Many thanks in advance if you can help me with my problem.
I have a "stats" table which contains players' info & stats for each season. I created a first slice on the "name" in order to display only one player's information.

I would like to use this player's characteristics to find similar player based on different criterion, example:

-age should be the same
-position should be the same
-only for the latest season
-etc...

I created different measures to capture these filtered elements. As you can see below, when I display them into cards, they return the good value:

mattcha_1-1699999912797.png


I tried a lot of different DAX formulas to create a new table / measure (still trying to figure out what's the best solution) but it never works.
I tried this one to create a new table just filtered on the first player position (Jude Belligham > central midfield) and no data appears:

mattcha_2-1700000094092.png


Same goes using other DAX formulas such as FILTER function.

First, It it possible to do what i'm trying to do?  If yes, how? 😭

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vtangjiemsft_0-1700127620241.png

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. 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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.

vtangjiemsft_0-1700127620241.png

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. 

mattcha
Regular Visitor

@Anonymous  and others, to give you a bit more context, here is some sample data from table "stats":

mattcha_0-1700039792463.png

Using the slicer "name" on Player I, that is what I'd have in my first part of the dashboard.

mattcha_2-1700040435875.png

 

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:

nameseasonagepositionscoregoals
Player G2023/202420 (+1 year from player I)Forward 45 (closest score from player I)5
Player H2023/202418 (-1 year from player I)Forward373
Anonymous
Not applicable

Can you give another example? From my understanding you want to select players that all have the same criteria? Why don't you just user different slicers if that is the case?

Hi @Anonymous , thanks for answering. 
I tried to simplify for the example but some of the criteria would be a bit different and specified in the formula, ex:
-age of similar player +/- 1 year
-I have also a score variable and final goal is to rank the new table with the lowest difference between player selected by the user and the similar ones (MIN of ABS("score of filtered player - score similar ones))

Basically, I'd like my graph Dashboard to be the easiest for the user, so only one slicer (=name of the player) if possible. 
If it's not possible, I will simply create a new table with new slicers based on age, position, latest season and a calculated column for the score difference.

Anonymous
Not applicable

What do your tables look like?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.