The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.