Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I am using two variables to show the month before the current date, one variable shows the year (vCompYear) and the other shows the month (vCompMonth).
For example,
* If the current month is October 2023 then vCompYear = 2023 & vCompMonth = 9.
* If the current month is January 2024 then vCompYear = 2023 & vCompMonth = 12.
In KPI I use these variables to display the previous month amount - work fine.
Sum({1<Year={'$(vCompYear),Month={'$(vCompMonth)'}>}Sales)
In addition, I need to calculate the cumulative amount of that year (vCompYear) up to that month (vCompMonth).
For example,
* If the current month is October 2023 then I will receive the amount of January to September 2023.
* If the current month is January 2024 then I will receive the amount of January to December 2023.
I tried some solutions I found here but I didn't get the right result.
How to calculate the cumulative amount?
Thanks.
Something like this maybe?
Sum({1<Year={$(vCompYear)},Month={"<=$(vCompMonth)"}>}Sales)
Something like this maybe?
Sum({1<Year={$(vCompYear)},Month={"<=$(vCompMonth)"}>}Sales)