Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Count opened cases by day with "for" loop

Hello,   I have following issue and I don't know how to start writting Dax measure (if it is possible in DAX). Lets say we have following data table: ID opened_at closed_at 1 opened_date...
  • johnt75's avatar
    3 years ago

    Try

    Open cases =
    VAR MaxDate =
        MAX ( 'Date'[Date] )
    VAR Result =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            REMOVEFILTERS ( 'Date' ),
            'Table'[Start date] <= MaxDate
                && (
                    ISBLANK ( 'Table'[End Date] )
                        || 'Table'[End date] > MaxDate
                )
        )
    RETURN
        Result