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
thhmez7
Helper III
Helper III

DAX Conditional count of same values

Hi guys,

 

in this example I want to count the products which have more than two rows, in combination with Brand.

thhmez7_1-1649790458025.png

 

Here Products C and E appear three times, so only these should be counted as 1 product. Other are counted as 0.

The sum would be 2.

Thank you for your help.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @thhmez7 

 

You can try the following methods.

Maesure:

Count =
COUNTX (
    FILTER (
        SUMMARIZE ( 'Table', 'Table'[Product], "count", COUNT ( 'Table'[Product] ) ),
        [count] > 2
    ),
    [Product]
)

vzhangti_0-1649991819466.png

Is this the result you want?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @thhmez7 

 

You can try the following methods.

Maesure:

Count =
COUNTX (
    FILTER (
        SUMMARIZE ( 'Table', 'Table'[Product], "count", COUNT ( 'Table'[Product] ) ),
        [count] > 2
    ),
    [Product]
)

vzhangti_0-1649991819466.png

Is this the result you want?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes, it works, thank you.

Basically similar to the previous measure, just count instead of countrows.

Thank you guys

amitchandak
Super User
Super User

@thhmez7 , Try a measure like

countx(Filter(Summarize(Table, Table[product], "_cnt", countrows(Table)), [_cnt] >2), [product])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

thanks, I tried it

thhmez7_0-1649860775286.png

But it returns this error:

thhmez7_1-1649860808451.png

 

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.

Top Solution Authors