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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Community,
I need help calculating the difference between two rows (capital) associated with the same SAME RUT AND DOCUMENT. Each row shows an amount of capital associated with a corresponding date.
Attached information on how I need it to be displayed (I need to get the column in bold):
Document | Rut | Date | Capital | Dif. Capital |
123456 | 12345678 | 07-12-2022 | 2419 | 0 |
987654 | 55555555 | 24-11-2021 | 1000 | 0 |
990111 | 98765432 | 21-01-2019 | 6508,97 | 0 |
990111 | 98765432 | 29-05-2019 | 6697 | 188,03 |
990111 | 98765432 | 11-12-2019 | 6634 | -63 |
990111 | 98765432 | 13-05-2020 | 7290 | 656 |
990111 | 98765432 | 03-12-2020 | 7258 | -32 |
990111 | 98765432 | 26-05-2021 | 7356 | 98 |
990111 | 98765432 | 05-11-2021 | 8866 | 1510 |
990111 | 98765432 | 01-12-2021 | 8795 | -71 |
990111 | 98765432 | 04-03-2022 | 8759 | -36 |
990111 | 98765432 | 27-04-2022 | 9345 | 586 |
990111 | 98765432 | 05-07-2022 | 9588 | 243 |
990111 | 98765432 | 06-02-2023 | 10136 | 548 |
For this I made the following calculated column:
I need to be able to condition this calculated column with a rut or other unique data.
Thank you very much and greetings!
@Syndicate_Admin , a new column
=
var _max = maxx(filter(Table, [document] = earlier([Document]) && [Date] < earlier([Date]) ), [Date] )
return
maxx(filter(Table, [document] = earlier([Document]) && [Date] =_max ), [captial] )
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s