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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.