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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sedric1
Helper III
Helper III

Need help creating a table visual based on matching criteria

I am not sure if this concept is possible based on my data layout but would love feedback.

I have table in the following structure (sports data) that I'm trying to fiilter and group based on multiple matching criteria:

sedric1_0-1599523662754.png

The matching criteria would be to find all rows with the same week, year, and team (all must match from row to row). The filter would then need to only show rows where the 'fd points' column is greater than 20. I thought maybe the functions summarize or groupby would make this work but I couldnt figure out how. Of the above table, the following two rows would return if successful:

sedric1_1-1599524334029.png

 

 

If this is possible, I would like to return the above sample output as a single row of data, where a new column is created to hold the 2nd "player" information. For example 

sedric1_2-1599524618378.png

If the single line is not possible, having multiple lines with the matching would still be super helpful. Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sedric1 , Not very clear. You can have table Like

filter(Summarize(Table,Table[week], Table[Year], Table[Player Name], Table[Position], Table[Team], Table[Stadium], Table[Opponent Name], "Fd Points" , Sum(Table[Fd Points])), [Fd Points] >20)

 

Or measure, That you can use with all other column

Sumx(filter(Summarize(Table,Table[week], Table[Year], Table[Player Name], Table[Position], Table[Team], Table[Stadium], Table[Opponent Name], "Fd Points" , Sum(Table[Fd Points])), [Fd Points] >20),[Fd Points])

 

If you want you can take Min and Max of Fd Points or any other column as per need

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@sedric1 - If you could post that data as text in a table that would be better, could give you a precise answer. But, try these measures:

Matching Player =
  VAR __Week = MAX([week])
  VAR __Year = MAX([year])
  VAR __Team = MAX([team])
  VAR __Player = MAX([player_name])
RETURN
  MAXX(FILTER('Table',[week]=__Week && [year]=__Year && [team]=__Team && [player_name]<>__Player),[player_name])

Matching Position =
  VAR __Week = MAX([week])
  VAR __Year = MAX([year])
  VAR __Team = MAX([team])
  VAR __Player = MAX([player_name])
RETURN
  MAXX(FILTER('Table',[week]=__Week && [year]=__Year && [team]=__Team && [player_name]=[Maching Player],[position])

Matching Points =
  VAR __Week = MAX([week])
  VAR __Year = MAX([year])
  VAR __Team = MAX([team])
  VAR __Player = MAX([player_name])
RETURN
  MAXX(FILTER('Table',[week]=__Week && [year]=__Year && [team]=__Team && [player_name]=[Maching Player],[fd points])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Sorry for the delay- i thought I posted this table earlier this evening, but I am not seeing my last attempt, so reposting the data table now:

 

weekyearplayer_namepositionteamstadiumopponent_namefd points
42019Mariota, MarcusQBtenaatl23.28
42019Woods, RobertWRtenhatl22.9
42019Brown, A.J.WRtenaatl22.9
52019Cousins, KirkQBminhden22.86
52019Cook, DalvinRBminaden22.8
142019Hopkins, DeAndreWRhouhden22.7

 

One thing to note is that there could be more than 1 matching player (same week + same team + has more than 20 fd points), which may change whether or not this is possible. I tried the solutions posted but could not build the table using those measures.

 

 

amitchandak
Super User
Super User

@sedric1 , Not very clear. You can have table Like

filter(Summarize(Table,Table[week], Table[Year], Table[Player Name], Table[Position], Table[Team], Table[Stadium], Table[Opponent Name], "Fd Points" , Sum(Table[Fd Points])), [Fd Points] >20)

 

Or measure, That you can use with all other column

Sumx(filter(Summarize(Table,Table[week], Table[Year], Table[Player Name], Table[Position], Table[Team], Table[Stadium], Table[Opponent Name], "Fd Points" , Sum(Table[Fd Points])), [Fd Points] >20),[Fd Points])

 

If you want you can take Min and Max of Fd Points or any other column as per need

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  and @Greg_Deckler My reply to this post seems to have disappeared again so reposting it (and hoping they dont all show up later!) but i did want to mention that the summarize table function got me most of the way to my goal. The downside is that I have to filter it and sort it to see the groupings I want.

 

New Table = filter(Summarize('2019fdnfl','2019fdnfl'[week], '2019fdnfl'[Year], '2019fdnfl'[player_name], '2019fdnfl'[Position], '2019fdnfl'[Team], '2019fdnfl'[Stadium], '2019fdnfl'[opponent_name], "Fd Points" , Sum('2019fdnfl'[Fd Points]),"Stack Size", CALCULATE(COUNTROWS('2019fdnfl'),ALL('2019fdnfl'),'2019fdnfl'[team] = EARLIER('2019fdnfl'[team]),'2019fdnfl'[week]=EARLIER('2019fdnfl'[week]),'2019fdnfl'[fd points]>20)),[Fd Points]>20)

 

This now produces the grouping when I add a filter and sort to a table visual:

sedric1_0-1599571104406.png

The one final question I have is whether or not I can consolidate this once again, so instead of 1 row per player, I add a new column to concatenate those player names in the group (and sum up their fd scores as well). I'm not quite sure how to modify the given query, but assume I may need to sumarize the summarized table to turn the results into this?

 

weekplayer_nameteampositionfd pointsstack size
1fitzgerald,larry;david johnson; murray,Kylerariwr;rb;qb66.623

 

@sedric1 - You could use SUMMARIZE again along with CONCATENATEX to concatenate your column values. Might want to use GROUPBY instead of SUMMARIZE, depends.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.