Forum Discussion
indhu
Helper III
8 years agofinding transaction based on latest date - help
Hi all, I have a table as follows Type userid date amount balance --------------------------------------------------- deposit 01 01-01...
- 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]
Anonymous
8 years agoNot 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
8 years agoAnonymous 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
- Anonymous8 years agoNot applicable
LASTDATE('Table'[DateField])That formula will provide you with the latest date in a table. You could put that inside a calculate statement.
- indhu8 years ago
Helper III
This gets the latest date on the whole :( not filtering based on the user id. I.e. individually.
when I used with condition,
latestdate = CALCULATE(LASTDATE(table[date]),ALLEXCEPT(table,table[userid]))
still failed as the date column duplicates :(
Any help is much appreciated Anonymous.
Thanks,
Indhu
- Anonymous8 years agoNot applicable
In that case, switch LASTDATE to MAX