Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Count times that appears in a table

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.

 

 

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@Anonymous

You need to create an auxiliary table as below

Capture.PNG

 

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] ) ) )

Capture.PNG

 

See more details in the attached pbix file.

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee

@Anonymous

You need to create an auxiliary table as below

Capture.PNG

 

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] ) ) )

Capture.PNG

 

See more details in the attached pbix file.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.