Forum Discussion
Count/CountA counting wrong category
- 5 years ago
Hi, Anonymous
Based on your description, I assume that you want to filter by player and get win% for each player. I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Names(a calculated table):
Names = DISTINCT( UNION( DISTINCT('Table'[Winner's Name]), DISTINCT('Table'[Loser's Name]) ) )You may create a measure as below.
Win % = var result = DIVIDE( COUNTROWS( FILTER( ALL('Table'), [Winner's Name]=SELECTEDVALUE(Names[Name]) ) ), COUNTROWS( FILTER( ALL('Table'), OR( [Winner's Name]=SELECTEDVALUE(Names[Name]), [Loser's Name]=SELECTEDVALUE(Names[Name]) ) ) ) ) return IF( ISBLANK(result), 0, result )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please post a sample data and your formulas.
I can't provide data because it's sensitive. However, I have isolated the problem.
My dataset is essentially [game_id] [winner's name] [loser's name] .
The reason I am having issues is that when I put [Count of Wins] and [Count of Losses] into a table, I don't have a common "name" column to filter them both into.
- amitchandak5 years agoSuper User
Anonymous , Do you have team or something like that to group /filter if not what is expected?
- Anonymous5 years agoNot applicable
I do not. I just want a way to filter by player and get someone's win%, etc
- bhagyashripatil5 years agoAdvocate I
Hello Anonymous ,
Is your data in this format ?
Please give some sample masked data, so that we get better idea. You can also give the sample output which you expect.