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 August 31st. Request your voucher.

Reply
dannytan1112
Helper I
Helper I

Countax minimum number of occurence

Let say i have a  SN column of the Table to use table contains the values "a", "a", "a", "b", "b", "c", "c", "c", "d", "e", "f", "g", "h", "h", "h", "h"

I want it to return number of SN with the occurence at least 3 times

a = 3 times ; c = 3 times ; h = 4 times

So i want to have return value of 3 

This is my measure 

=COUNTAX(
'Table to use',
SUMX(
FILTER('Table to use', 'Table to use'[SN] = EARLIER('Table to use'[SN])),
1
) >= 3
)

 

any ideas how to do it? Thanks

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @dannytan1112 

 

Measure = 
VAR numAppearances_ = 3
RETURN
    COUNTROWS (
        FILTER (
            DISTINCT ( Table1[SN] ),
            CALCULATE ( COUNT ( Table1[SN] ) ) >= numAppearances_
        )
    )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @dannytan1112 

 

Measure = 
VAR numAppearances_ = 3
RETURN
    COUNTROWS (
        FILTER (
            DISTINCT ( Table1[SN] ),
            CALCULATE ( COUNT ( Table1[SN] ) ) >= numAppearances_
        )
    )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Thank you so much

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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