Forum Discussion

RafaelRSantos_'s avatar
RafaelRSantos_
Frequent Visitor
4 years ago
Solved

Sum total previous date filtered

Hi, I need help to create a measure to Sum Total Value before the date specified in slice. I have a stars chema FactAccountingMoviment SkDimDate SkDimAccount CreditValueMoviment DebtValueMovim...
  • RafaelRSantos_'s avatar
    4 years ago

    I look around documentation and inside forum and i create this result.

     

    PreviousBalance =
    VAR MinDate = CALCULATE( MIN('Public DimDate'[Date]), ALLSELECTED('Publico DimDate'[Date]) )
    RETURN
    CALCULATE(
    SUMX('Account FactAccountingMoviment',
    'Account FactAccountingMoviment'[CreditValue] - 'Account FactAccountingMoviment'[DebtValue])
    ,FILTER(ALL('Public DimDate'),'Public DimDate'[Date] < MinDate)
    )