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.
bhagyashripatil
5 years agoAdvocate I
Hello Anonymous ,
Try ignoring any filters applied on the column, on which you are calculating Measure 'B'. You can achieve this in your DAX, by using ALL( ) function in your filter context of DAX.
Or you can share your masked DAX, so that I can get more clarity on your issue.
Anonymous
5 years agoNot applicable
Pls see above explanation ❤️