March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have a table like below:
Current Balance | as_of_date | deal | Price | Value |
444 | 12/14/22 | A | 70 | 3 |
5674 | 12/14/22 | A | 50 | 5 |
279 | 12/14/22 | A | 60 | 8 |
.. | 12/14/22 | B | 70 | 5 |
.. | 12/14/22 | B | 60 | 3 |
.. | 12/14/22 | B | 50 | 10 |
.. | 12/13/22 | A | 70 | 20 |
.. | 12/13/22 | A | 60 | 90 |
.. | 12/13/22 | A | 50 | 40 |
I want to add a column YTD change such that for a particular deal, it is calculated as follows:-
YTD Change for Deal A for Price 70 = Filter the table for Deal A and Price 70 and then >> Value for Latest Date minus Value for 1st date of the year.
Similarly for Deal A for Price 50 = Filter the table for Deal A and Price 50 and then >> Value for Latest Date minus Value for 1st date of the year.
Need help with how to use DAX for this calculation
Solved! Go to Solution.
Hi @saanchi2804 , try this:
- Create this calculate column:
Concat = Table_[deal ]&Table_[Price ]
- Create this another calculate column:
Result = var min_p=CALCULATE(MAX(Table_[Value ]),ALLEXCEPT(Table_,Table_[Concat]))
return
min_p-Table_[Value ]
The result:
Best Regards
Hi @saanchi2804 , try this:
- Create this calculate column:
Concat = Table_[deal ]&Table_[Price ]
- Create this another calculate column:
Result = var min_p=CALCULATE(MAX(Table_[Value ]),ALLEXCEPT(Table_,Table_[Concat]))
return
min_p-Table_[Value ]
The result:
Best Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |