Forum Discussion

mithunt's avatar
mithunt
Frequent Visitor
1 year ago
Solved

Help with cascade formula

Hello PowerBians,    I am trying to achive open ticket calculation based on logic attached with this question, However it is extremly difficult in Power BI, where as in Excel its just drag the for...
  • danextian's avatar
    1 year ago

    Hi mithunt 

     

    Given the logic provided, 8/21 shoud return 219 (220-43+44) but yours is 221. Following the same logic, this calc column should work.

    Open2 = 
    VAR _currentDate = Data[Date]
    VAR _open =
        SUM ( Data[Open] ) --assuming there's only one open date data
    VAR created_resolved =
        SUMX (
            FILTER ( Data, Data[Date] > _currentDate ),
            - Data[Created] + Data[Resolved]
        )
    RETURN
        _open + created_resolved
    

    As a measure

    Open measure = 
    VAR _open =
        SUMX ( ALL ( Data[Date] ), CALCULATE ( SUM ( Data[Open] ) ) ) --assuming there's only one open date data
    VAR _currentDate =
        MAX ( Data[Date] )
    VAR created_resolved =
        SUMX (
            FILTER ( ALL ( Data ), Data[Date] > _currentDate ),
            - Data[Created] + Data[Resolved]
        )
    RETURN
        _open + created_resolved