Forum Discussion

sandeep_sharma's avatar
1 year ago
Solved

count basis date

I have below data....there is another calendar table that has inactive relationship with Expiration date column...I want to count the items as per expiration date....so when I put calendar date in a ...
  • johnt75's avatar
    johnt75
    1 year ago

    For that you couldn't rely just on relationships, as only one can be active at a time. You would need something like

    Billed and Expired =
    VAR VisibleDates =
        VALUES ( 'Date'[Date] )
    VAR Result =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            TREATAS ( VisibleDates, 'Table'[Expiry Date] ),
            TREATAS ( VisibleDates, 'Table'[Billing Date] )
        )
    RETURN
        Result