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

Getting the frequency of each value in a column

I have a table that has a column ("Item" in the example below) that I want to produce the "Frequency" column for. Is there a way to create a column in DAX that would provide me with the numbers on the right? If not, would I need to use a measure?

I think duplicating the query and getting a count from the new table would work, but Im wondering if there is a way to do this without needing to do this.

GooseHelpful199_0-1704404728994.png

 

1 ACCEPTED SOLUTION
cjgreene
Regular Visitor

You could use a calculated column or a measure.


For the calculated column:

Frequency =
COUNTROWS(
    FILTER(
        Table1,
        Table1[Item] = EARLIER(Table1[Item])
    )
)

The calculated measure is easier:
Frequency = COUNTROWS(Table1)

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Do a SUMMARIZE over that column with COUNTROWS. 

 

Also check out this new-ish function:

EVALUATE COLUMNSTATISTICS()

cjgreene
Regular Visitor

You could use a calculated column or a measure.


For the calculated column:

Frequency =
COUNTROWS(
    FILTER(
        Table1,
        Table1[Item] = EARLIER(Table1[Item])
    )
)

The calculated measure is easier:
Frequency = COUNTROWS(Table1)

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.