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.
Hi folks,
I have a following table in which I need to create a measure which will calculate a delta for a document (basicaly saldo) between current/selected date and date before for a document.
So for example, saldo for document 1b for April is 3 (calc: 15-12 ). You can see expected results in columns that are in yellow , red font.
How did I go about this problem ? I could not use a function previousmonth because booking does not need to be in previous mont but later... so I ranked bookings for a document based on date and the latest booking is always 1 and the booking that's before is always 2 or basically by 1 more. I thought that with ranking I can get it done but i got stuck. i used following code but it did not work well:
Do you have any idea to to do it? BTW, I also have a virtual table for calendar that is connected to fact table to easily filter thru time.
measure =
var a_= MAX('TABLE'[Z_Rank])
RETURN
var Prior_ =
CALCULATE([AMOUNT],
FILTER(ALLSELECTED('TABLE'),
'TABLE'[Z_Rank]= a_-1)
)
var Current_ =
CALCULATE([AMOUNT],
FILTER(ALLSELECTED('TABLE'),'TABLE'[Z_Rank]= a_)
)
RETURN
var Final_ =
(Current_- Prior_)
RETURN
DIVIDE(Final_,Final_)*Final_
thank you a lot for your suggestons and time!
much appreciated
Solved! Go to Solution.
@CSSR , You can use visual calculation or offset function
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
Next-Level Power BI Visual Calculations with Offset, Index, Rank, RowNumber| February 2024 Update:
https://www.youtube.com/watch?v=JwMF0endTPY&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
@CSSR , You can use visual calculation or offset function
Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U
Next-Level Power BI Visual Calculations with Offset, Index, Rank, RowNumber| February 2024 Update:
https://www.youtube.com/watch?v=JwMF0endTPY&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
@amitchandak , thank you for showing me the directon. I used offset function and all the tests that I have done so far looks promissing. 😉