Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time 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!
Solved! Go to Solution.
@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 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.
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?
@Anonymous Can you provide some sample data?
The data that I am using is the one in the purple table in my question.
Thanks Colacan. This is really helpful. I will have a go.
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.
User | Count |
---|---|
41 | |
27 | |
23 | |
19 | |
16 |
User | Count |
---|---|
55 | |
35 | |
21 | |
18 | |
15 |