Forum Discussion
shishir999
8 years agoHelper II
Recursive Calculation for What-If scenario-SG
I get stuck here. Please see the sample data: DataSet-1: Created_Date IN OUT Balance Expected_Date Cumm_Bal 11/21/2017 8 4 4 11/23/2017 4 11/22/2017 7 3 4 11/24/2017 8 11/23/2017 6 2 4 11/25/2017 12 N...
- 8 years ago
Thanks Eric, your idea helped in fixing my issue...SG
Eric_Zhang
8 years agoMicrosoft Employee
shishir999 wrote:
I get stuck here. Please see the sample data: DataSet-1: Created_Date IN OUT Balance Expected_Date Cumm_Bal 11/21/2017 8 4 4 11/23/2017 4 11/22/2017 7 3 4 11/24/2017 8 11/23/2017 6 2 4 11/25/2017 12 Need to Predict expected days, when value become ZERO (0). Cumm_Bal: 12 Expected_Date IN OUT Balance Exp_Zero 11/24/2017 3 5 -2 10 Cumm_Bal + Balance 11/25/2017 3 5 -2 8 Exp_Zero (1) + Balance 11/26/2017 3 5 -2 6 11/27/2017 3 5 -2 4 11/28/2017 3 5 -2 2 11/29/2017 3 5 -2 0 So, Total No_Of_Days= 6 Here, I'm able to calculate Balance under 2nd dataset. But, unable to get Exp_ZERO value, on a recursive basis on last Exp_Zero value. Also, can we able to restrict user, will be able to Select only 2 parameters...? Thanks in Advance for help.
Per my understanding, you can create What_If_In and What_If_Out parameteres and measures as below. See more in the attached pbix file.
Cumm_Bal = SUM(Table1[IN])-SUM(Table1[OUT]) Total No_Of_Days = VAR diff = What_If_In[What_If_In Value]-What_If_Out[What_If_Out Value] RETURN IF(diff>0,999, DIVIDE([Cumm_Bal],diff*-1) )
- shishir9998 years agoHelper II
Thanks Eric, your idea helped in fixing my issue...SG