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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
foging
Frequent Visitor

DAX measure count where column values match

Hi all!

 

I'm trying to count the number of rows where two different columns match and don't match.

 

Table 1:          

             

CoumnA ColumnB
AABB
CCCC
AAAA
BBBB
CCBB

 

The answers I'm looking for here is:

Matching = 3

Not matching = 2

 

I've tried dofferent versions of COUNTROW but I'm simply failing on the syntax. Any ideas?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @foging 

COUNTROWS ( FILTER ( 'Table', 'Table'[XolumnA] =  'Table'[XolumnB] ) )

and

COUNTROWS ( FILTER ( 'Table', 'Table'[XolumnA] <>  'Table'[XolumnB] ) )

View solution in original post

2 REPLIES 2
foging
Frequent Visitor

Worked!

Thank you @tamerj1 !

tamerj1
Super User
Super User

Hi @foging 

COUNTROWS ( FILTER ( 'Table', 'Table'[XolumnA] =  'Table'[XolumnB] ) )

and

COUNTROWS ( FILTER ( 'Table', 'Table'[XolumnA] <>  'Table'[XolumnB] ) )

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.