Forum Discussion
shanipowerbi
Helper III
6 years agoSecond Last Invoice Amount
Hi Experts I need your help to calculate second last invoice amount. I have two table that contain 1 - Invoive Data Invoice ID / User ID / Invoice Amount / Invoice Date 2 - User Profiling D...
- 6 years ago
I believe you are trying to create a column.
This should work.
2ND Last Invoice Amount =
VAR LAST_DATE =
LASTDATE ( Invoice[Invoice Date] )
VAR PREVIOUS_DATE =
CALCULATE (
MAX ( Invoice[Invoice Date] ),
FILTER ( ALL ( Invoice[Invoice Date] ), Invoice[Invoice Date] < LAST_DATE )
)
RETURN
CALCULATE (
SUM ( Invoice[Invoice Amt] ),
Invoice[Invoice Date] = PREVIOUS_DATE
)If it helps mark it as a solution.
Kudos are nice too
Anonymous
6 years agoNot applicable
is the invoice date different for different users?
try the below post which is similar situation