Forum Discussion

s--turn's avatar
s--turn
Helper II
3 years ago
Solved

Identifying which year-ends (Dec 31st) are between two dates

Hello,   I need to be able to produce counts for the total number of subscriptions that were active as of December 31st each year.  This is the kind of raw data I have:   Subscription ID Vali...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi s--turn ,

     

    You can try this measure.

     

    Count of Subscriptions =
    CALCULATE (
        COUNT ( 'Table'[Subscription ID] ),
        FILTER (
            'Table',
            'Table'[Valid From] <= MAX ( 'Calendar'[Date] )
                && 'Table'[Valid To] >= MAX ( 'Calendar'[Date] )
        )
    )

     

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.