Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Sumif between dates in two different tables

Hi Guys,   I need help summing the values of a second table if they are in the next 60 days of a date in the first table. Its easiers ifi Show it:   Table 1: SolicitingDate  01/01/2019        ...
  • jdbuchanan71's avatar
    jdbuchanan71
    7 years ago

    It probably has something to do with where you are pulling the date fields in from and the joins in your model.  When I test this measure and pull the date in from 'Solicitação Resgates' it works.

    Total Redemptions next 60D = 
    VAR StartingDate = MAX('Solicitação Resgates'[DataSolicitacao])
    VAR EndingDate = StartingDate + 60
    RETURN
        CALCULATE (
            SUM ( 'Cotizações Resgates'[Solicitação Resgates.Financeiro Ajustado] ),
            FILTER (
                'Cotizações Resgates',
                'Cotizações Resgates'[DataCotizacao] >= StartingDate
                && 'Cotizações Resgates'[DataCotizacao] <= EndingDate
            )
        )