0
votes

I have question about Power BI - DAX. I have column "Amount" (number) and "PostDate" (datetime), so I can summarize total "Amount" until last "PostDate" stored in table.

How can achieve, that i have possibilty to show SUM calculated value (from MIN date (smallest date in table until (TODAY - N) days)

For example, current date is 25.1.2019:

PostDate    Amount
1.12.2018     5€
1.1.2019      3€
24.1.2019     10€ 
25.1.2019     7€ 

Total SUM = 25, but if I want to get SUM before 15 days, I want to get SUM = 8

Thank you and best regards

1

1 Answers

1
votes

I think this should work.

=calculate(SUM(PostDate Amount), FILTER(yourTable, dateColumn <= today() - 15))

You calculate the expression SUM() but only on the rows that fulfill the FILTER() logic (today() - 15)