Forum Discussion
finding transaction based on latest date - help
Hi all,
I have a table as follows
Type userid date amount balance
---------------------------------------------------
deposit 01 01-01-2018 20 101
withdraw 01 02-01-2018 101 00
deposit 02 02-01-2018 05 05
deposit 02 02-01-2018 10 15
I want to find the latest balance based on the date for each user. Can somebody please help?
Thanks,
Indhu.
- Anonymous8 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]
5 Replies
- AnonymousNot applicable
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]
- indhu
Helper III
Anonymous Thanks for your reply. Sometimes the record doesn't match. I want to find the latest date in spite of the transaction type I want to find the latest date, and get the balance alone. Is that possible?
Thanks,
Indhu
- AnonymousNot applicable
LASTDATE('Table'[DateField])That formula will provide you with the latest date in a table. You could put that inside a calculate statement.