I have some data that looks like the following, where the same Id
is repeated in multiple rows, but different Victory
values.
Id | Victory |
---|---|
1 | FALSE |
1 | FALSE |
1 | TRUE |
2 | FALSE |
2 | FALSE |
2 | TRUE |
3 | FALSE |
3 | FALSE |
3 | FALSE |
I am trying to count the number of Victory
per Id
, so if there is a row where Victory
is TRUE
, then it should be considered a victory.
I have attempted to use a basic calculated field, which I thought would do the trick. However, it counts victory as TRUE
right, but victory FALSE
includes any Id
where FALSE
is present.
In other words, the above data would count 3x FALSE
, and 2x TRUE
, using the following calculated field:
COUNT ( { FIXED [Id]: MAX([Victory]) } )
This is the visualization I get, where I would expect the count of FALSE
to only be 1, but is 3.
I have tried numerous variations, but just cannot seem to get the desired results.
I am using Tableau 2020.4.
EDIT
I came across two different solutions to my problem, which I have attached screenshots of below. Note that Victory
is replaced by WIN
and Id
is replaced by Row Id
, but the example should be clear.
Solution 1
Solution 2