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
kangx322
Frequent Visitor

COUNTIFS in DAX

Hello, I am trying to do calculation below: 

The logic is to count rows that have same color but later date

 

What would be the dax formula for this?

kangx322_0-1634824647868.png

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

I think this will do it.

Please post data (not a picture) next time.

ColumnW = 
VAR _color = TableL[Color]
VAR _rowdate = TableL[Date]
RETURN
COUNTROWS(FILTER(TableL, TableL[Color] = _color && TableL[Date] > _rowdate))

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

I think this will do it.

Please post data (not a picture) next time.

ColumnW = 
VAR _color = TableL[Color]
VAR _rowdate = TableL[Date]
RETURN
COUNTROWS(FILTER(TableL, TableL[Color] = _color && TableL[Date] > _rowdate))

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.