Forum Discussion
Alejandro_bi
8 years agoFrequent Visitor
How to know the last invoice amount
Hello, in a table I have the date of issuance of an invoice, the amount of said invoice and the client to whom it corresponds. I would like to know when it was the last date that an invoice was issued to the client and its amount. Someone help me?
Thank you.
Hi Alejandro_bi
Use this formula.
Hopefully it will get you the results
NEW Table = SUMMARIZE ( Table1, Table1[Client], "Last Date", LASTDATE ( Table1[Date] ), "Last Amount", CALCULATE ( SUM ( Table1[Amount] ), FILTER ( ALLEXCEPT ( Table1, Table1[Client] ), Table1[Date] = MAX ( Table1[Date] ) ) ), "Last Invoice ID", CALCULATE ( VALUES ( Table1[Invoice ID] ), FILTER ( ALLEXCEPT ( Table1, Table1[Client] ), Table1[Date] = MAX ( Table1[Date] ) ) ) )
15 Replies
- Zubair_Muhammad
Community Champion
HI Alejandro_bi
Try these MEASURES
LastDate = LASTDATE ( ALL ( Table1[Date] ) )
Client_LastDate = VAR Last_Date = LASTDATE ( ALL ( Table1[Date] ) ) RETURN CALCULATE ( VALUES ( Table1[Client] ), Table1[Date] = Last_Date )Amount_LastDate = VAR Last_Date = LASTDATE ( ALL ( Table1[Date] ) ) RETURN CALCULATE ( SUM ( Table1[Amount] ), Table1[Date] = Last_Date )- Alejandro_biFrequent Visitor
Sorry, I've tried it but all fields are blank. When you use VAR or Return, what is it for? I'm a bit of a rookie in all this.
Thanx
- Zubair_Muhammad
Community Champion