Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
My data :
Player id
A 1
A 2
B 1
C 1
C 3
I want to have the number of id which is identical to all the players which are selected by a filter. For example if I select A, the value is 2, if I also select B the value is 1 and if I select all three players the value is only 1 because there is only the id 1 which is common.
I try to count with a measure the number of common IDs between all the players but I cannot find the right formula.
Thanks
Solved! Go to Solution.
Hi, @Jeremy19 ;
You could try it.
count =
var _playnum=CALCULATE(DISTINCTCOUNT('Table'[Player]),ALLSELECTED('Table'))
var _countall=SUMX( SUMMARIZE('Table',[Player],[id],"1", IF(_playnum= CALCULATE(COUNT('Table'[id]),FILTER(ALLSELECTED('Table'),[id]=MAX('Table'[id]))),1,0)),[1])
return
DIVIDE(_countall ,_playnum)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Jeremy19 ;
You could try it.
count =
var _playnum=CALCULATE(DISTINCTCOUNT('Table'[Player]),ALLSELECTED('Table'))
var _countall=SUMX( SUMMARIZE('Table',[Player],[id],"1", IF(_playnum= CALCULATE(COUNT('Table'[id]),FILTER(ALLSELECTED('Table'),[id]=MAX('Table'[id]))),1,0)),[1])
return
DIVIDE(_countall ,_playnum)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try this. @Jeremy19
Count of common IDs = CALCULATE(COUNTROWS(FILTER(SUMMARIZE('TABLE','TABLE'[ID],"duplicates',CALCULATE(COUNTROWS('TABLE'))),[duplicates]>1)))
thingsclump
Hi @Jeremy19
try it, modify the Table name and Column name accordingly
count_num =
VAR CurPlayer =VALUES('Table1'[Player])
VAR CurCount=COUNTROWS(CurPlayer)
VAR TI=FILTER(Table1,Table1[Player] IN CurPlayer)
VAR T2=GROUPBY(TI,Table1[id],"Players",COUNTAX(CURRENTGROUP(),[Player]))
RETURN
COUNTROWS(FILTER(T2,[Players]=CurCount))
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
88 | |
86 | |
83 | |
68 | |
49 |
User | Count |
---|---|
138 | |
111 | |
104 | |
65 | |
64 |