Forum Discussion

kovan's avatar
kovan
Frequent Visitor
4 years ago
Solved

Calculating Total Balances

hi community   I am working on a project where I am trying to add the total balances of id numbers. In order to get this, I need to pull the last balance posted from our files from several id numbe...
  • tamerj1's avatar
    4 years ago

    kovan 

    Please use the following measure

    MyMeasure =
    SUMX (
        SUMMARIZE (
            'Balance',
            'Balance'[created_at],
            'Balance'[account_id]
        ),
        CALCULATE (
            VAR maxid =
                MAX ( 'Balance'[id] )
            RETURN
                CALCULATE ( SUM ( 'Balance'[balance] ), 'Balance'[id] = maxid )
        )
    )