Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Cumulative Total for Financial Years only

Hi there,
I am trying to calculate the cumulative cash outflows or cash inflows. And I dont have a data table for this as the data are only on financial year end, i.e. 30/6/20XX. (Please ref to the 3rd screenshot)

 

I tried to use the following code but seems not working.  Please note the table name is TEST and DIM_Period is my period dimension table which is not in days.  

 

This is my period table. 

Please help 😄 Truly appreciate!

 

 

 

 

  • Anonymous  Hi, If you use VAR as expression of calculate, it would not work as you intended becuase VAR work like constant when one declares it. In other words, in your formular, when you declare net_cash, it became constant number (the total of cash_inflows). so it return always the same number regardless of modificatio of CALCULATE. and it applies to Las visible period as well.

     

    To resolve your issue, you should create measures for net_cash & Las visible period or dont use VAR (use the formular derectly inside CALCULATE)

     

    Hope this helps you.

6 Replies

  • bcdobbs's avatar
    bcdobbs
    Icon for Community Champion rankCommunity Champion

    Hi,

    Once you load the sum into the variable net_cash it becomes fixed and is not affected by your later calculate.

     

    If you put that code directly in to the calculate it will get further than before. Or you could define a separate measure called net cash and use that inside the calculate.

  • Anonymous  Hi, If you use VAR as expression of calculate, it would not work as you intended becuase VAR work like constant when one declares it. In other words, in your formular, when you declare net_cash, it became constant number (the total of cash_inflows). so it return always the same number regardless of modificatio of CALCULATE. and it applies to Las visible period as well.

     

    To resolve your issue, you should create measures for net_cash & Las visible period or dont use VAR (use the formular derectly inside CALCULATE)

     

    Hope this helps you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Colacan. This is really helpful. I will have a go. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Colacan,

      I had created measures for net_cash & LastVisible Period separately as below. However it seems not working. I suspect if this is something to do with my Period table?

       

       

      • smpa01's avatar
        smpa01
        Icon for Community Champion rankCommunity Champion

        Anonymous  Can you provide some sample data?