Forum Discussion
Anonymous
5 years agoNot applicable
Count/CountA counting wrong category
This is such a simple problem that I have spent HOURS trying to solve with no avail. I have a table with plenty of categories, say A, B, C, D, etc. I have a measure that Counts values in column A,...
- 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.
Anonymous
5 years agoNot applicable
I do not. I just want a way to filter by player and get someone's win%, etc
bhagyashripatil
5 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.