Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello!
I'm trying to calculate the amount of sold products from last year so I can compare them with the amount of sold products this year. When a product has no sells in a week, the number of sold products last year has not been calculated.
The picture below shows difference between week 3, 5 and 6.
Total sales TY and LY. Difference between total and yearweek.
LY Sales
Using same period last year will not work, because this formula takes only dates into account and my table only no dates, but only yearweek. I do have a calendar table with date, year, year_iso, weeknum, yearweek, month etc.
At the moment I'm using the fomula:
Does anyone know how I can calculate the sales of last year even when there are this yearweek no sales?
Hi K_p
Did you want to achieve result like below?
If so, you could refer to my sample. If not, please correct me and inform me more detailed information (such as your sample data and your expected output).
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply!
What I would like to do is to display one table with the results of the sales from this year. I actually meant to say is that I would like to see the results of 2018 in the table of 2019 (see attached file).
As example, when the slicer selects customer 'a' then I do not see this customer ordered also product y in week 4 of 2018.
When I select everything, the totals in last year sold are correct, although not all data is displayed in the table.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |