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 issue...
- 8 years ago
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] ) ) ) )
Zubair_Muhammad
Community Champion
8 years agoHI 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_bi8 years agoFrequent 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_Muhammad8 years ago
Community Champion
- Alejandro_bi8 years agoFrequent Visitor
Yes, as you have indicated, but everything appears without data.