The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I have a table similar to the below one:
Name Amount
----------------------------
peter 5
Mark 4
peter 3
Matthias 7
Jean 5
Luque 2
peter 23
Jean 45
I create a table to see how many time appears each one, so similar like this:
Name count(name)
----------------------------
peter 3
Mark 1
Matthias 1
Jean 2
Luque 1
what I want to get is a table to see how many times appears each count(name) in the table, something like:
count(name) times
------------------------
3 1
2 1
1 3
It means there is 1 person that appears 3 times, 1 person appears 2 times and 3 people 3 times.
How can I do it?
Thanks.
Solved! Go to Solution.
@Anonymous
You need to create an auxiliary table as below
And then create measures as below
Times_ = VAR SummariedTbl = SUMMARIZE ( yourTable, yourTable[Name], "countTimes", COUNTA ( yourTable[Name] ) ) RETURN IF ( ISBLANK ( COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) ) ), 0, COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) ) )
Or
Times = VAR SummariedTbl = SUMMARIZE ( yourTable, yourTable[Name], "countTimes", COUNTA ( yourTable[Name] ) ) RETURN COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) )
See more details in the attached pbix file.
@Anonymous
You need to create an auxiliary table as below
And then create measures as below
Times_ = VAR SummariedTbl = SUMMARIZE ( yourTable, yourTable[Name], "countTimes", COUNTA ( yourTable[Name] ) ) RETURN IF ( ISBLANK ( COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) ) ), 0, COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) ) )
Or
Times = VAR SummariedTbl = SUMMARIZE ( yourTable, yourTable[Name], "countTimes", COUNTA ( yourTable[Name] ) ) RETURN COUNTROWS ( FILTER ( SummariedTbl, [countTimes] = MAX ( countTable[count] ) ) )
See more details in the attached pbix file.