Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community,
I have a datatable where we have sales and profit for different items for different years.
Now, the ask is that "Sales" should be calculated only when the "Item name" exists for the previous year. Also, we dont have a date/calendar table.
Example:
When "A" is selected under "Item" and "2022" is selected from Year silcer. Sales value should be 100.
when Year "2021" is selected Sales should be 200 (Apple)+100 (Papaya) = 300
Item | Item name | Year | Sales | Profit |
A | Apple | 2022 | 100 | 200 |
A | Apple | 2021 | 200 | 400 |
A | Apple | 2020 | 500 | 1000 |
A | Papaya | 2021 | 100 | 400 |
A | Papaya | 2020 | 40 | 160 |
V | Cucumber | 2022 | 150 | 500 |
V | Cucumber | 2021 | 250 | 800 |
Is it possible to achieve this in power bi - dax?
Thanks for your help in advance.
Solved! Go to Solution.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |