Forum Discussion
How to work Running Total with VALUES
- 1 year ago
hi lbendlin ,
I only partly followed your suggestion for Running Total of the differences in days between the current share date and the initial, first share date. I used the DATEDIFF function after setting a ‘First Share Date’ and a ‘Current ShareDate’.
Similarly, I set a ‘First Share Value’ and a ‘Last Share Value’. The difference between the two values gives me the Running Total in the filter context.
In other words, I kept the double relationship of the two date columns in the fact table with the Calendar Table, but I followed your suggestion of calculating the days as the difference between the two dates.
This is fine for now.
Below is a picture of the resultThank you
The result I want to obtain is a Running Total of the days between two consecutive dates.
I don't fully understand what you are trying to achieve, but I don't think you need a running total. You only need to find the min and max date for the range you are interested in, regardless of how many valuation dates you have.
hi lbendlin
Above you wrote that you did not fully understand what I meant to do.
Now that I have the two Running Totals I have finally been able to calculate, time by time, the interest rate, simple for periods of less than a year and compound for longer periods.
And all the calculations concerning the valuation and the development of the share value are based on the valuation dates column while everything concerning the amount of payments/disbursements is based on the payments/disbursements column.
In the image you can see that the two types of measurements coexist without interference. The empty rows are the dates of the payments that are not directly reflected in the valuation dates and are neutral for the purposes of calculating running totals and interest rates.
I think this is an important result because with the DAX alone I have left the source of my data unchanged without neglecting my objectives.
I hope I have helped you understand.
Kind regards.