Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I have a table of the following type:
Month | Year | Qty 1 | Qty 2 |
1 | 2022 | 500000 | 100000 |
2 | 2022 | 400000 | 150000 |
I want a new column "Delta Qty 2" which is the difference between Qty 2 of the current month and Qty 2 of the previous month, same year. In the above example it shoul be: 150000 - 100000 = 50000
How can I do it with DAX?
Thanks.
Solved! Go to Solution.
@Log2Ins , A new column
Delta Qty 2 =
var _sum = sumx(filter(Table, [Year] =earlier([Year]) && [Month] =earlier([Month]) -1) , [Qty 2])
return
[Qty 2] - _sum
@Log2Ins , A new column
Delta Qty 2 =
var _sum = sumx(filter(Table, [Year] =earlier([Year]) && [Month] =earlier([Month]) -1) , [Qty 2])
return
[Qty 2] - _sum
Thank you very much!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
9 | |
9 | |
6 | |
5 |
User | Count |
---|---|
17 | |
15 | |
10 | |
9 | |
8 |