Forum Discussion

kangx322's avatar
kangx322
Frequent Visitor
4 years ago
Solved

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?

 

  • 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))

1 Reply

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity 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))