I've a table 'invoice' of amount with different Dates, i want to sum the amount for the max date.
For example if the max date is 25/03/2022, i'll sum only the rows of this date.
last_month_amount = calculate(SUM(invoice[amount]),FILTER(invoice, invoice[date] = LASTDATE('invoice'[date])))
but it calculate all the amounts without any filter.
in sql i want this:
select sum(invoice.amount)
from invoice
where invoice.date = (select max(date) from invoice)
but i got this
select sum(invoice.amount)
from invoice