my problem is
I need the distinct count of sport with string consist of ball/ team but only for won = 1
the orginal column only contain team,sport,alias,name
won & current count are addcolumns
I need the expected count as result instead of current count
I'm not able to use won as filter as it as in addcolumns
this is table
this is table2
Go to Solution.
Hi @newbie9 ,
You can create two measures as below to get it, please find the details in the attachment.
VAR _alias =
SELECTEDVALUE ( 'table'[alias] )
VAR _player =
MAX ( 'table2'[player] ),
FILTER ( 'table2', 'table2'[alias] = _alias )
IF ( ISBLANK ( _player ), 0, 1 )
Expected count =
VAR _team =
SELECTEDVALUE ( 'table'[team] )
DISTINCTCOUNT ( 'table'[sport] ),
ALLSELECTED ( 'table' ),
'table'[team] = _team
&& CONTAINSSTRING ( 'table'[sport], "*ball*" )
&& [Won] = 1
View solution in original post
Now the results count is coming as expected
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.