Forum Discussion
Last 2 year amount
Hi All,
I want a sum(amount) of last 2 year.Means sum(amount) group by last 2 year.
Like i want last 2 year sum.
Year amount
2017 100$
2018 200$
-----------------
TOTAL 300$
Thanks
Narender
Hi Narender,
Try to use [Date] instead of [Enter_Date], please.
Best Regards,
Dale
19 Replies
- Greg_Deckler
Community Champion
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- v-jiascu-msft
Microsoft Employee
Hi Narender,
We can get the total in the "Total" row of the visual with the formula below. What's your issue?
Sales = sum('table'[Amount])Best Regards,
Dale
- Narender
Resolver I
Hi Dale,
your expression will show the total amount. if i apply year in dimention in chart then it will show year wise amount.
I have year starting from 2000 to 2018 . So I want only last 2 year amount.
Means 2017 & 2018 amount only.
Year Amount
2017 10$
2018 20$
Total 30$
So when 2019 will come then
It will show data for 2018 & 2019 only.
Thanks,
Narender
- pawel1
Kudo Kingpin
what about the DATESINPERIOD function?
last 2 years of sales =
CALCULATE([Total Sales],
DATESINPERIOD('Date'[Date], MAX('Date'[Date]),-2,YEAR))