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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.