Forum Discussion

indhu's avatar
indhu
Icon for Helper III rankHelper III
8 years ago
Solved

finding transaction based on latest date - help

Hi all,   I have a table as follows    Type              userid       date            amount        balance --------------------------------------------------- deposit          01         01-01...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Try these 3 measures:

    Deposits = CALCULATE(
    	SUM('YourTable'[amount]),
    	ALL('YourTable'),
    	'YourTable'[Type] = "deposit"
    )
    Withdrawals = CALCULATE(
    	SUM('YourTable'[amount]),
    	ALL('YourTable'),
    	'YourTable'[Type] = "withdraw"
    )
    Balance = [Deposits] - [Withdrawals]