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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors