Forum Discussion
Forecast Recoveries
- 5 years ago
Hi, Anonymous
Try codes as below:
1.Create a calendar table:
Calculated table:Calendar = ADDCOLUMNS( CALENDAR(DATE(2020,12,01),DATE(2021,1,31)), "YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ) )create a sort column for "YearMonthnumber":
No.Month = RANKX('Calendar','Calendar'[YearMonthnumber],,ASC,Dense)2. using lookupvalue to find the corresponding systems cost( calculated column)
Recovey = LOOKUPVALUE(Systems[Cost],Systems[System],Cost[Systems])3.create measure to calculate next month recovery:
Next month Recovey = VAR _nextmonth = CALCULATE ( MAX ( 'Calendar'[No.Month] ), 'Calendar'[Date] = TODAY () ) + 1 RETURN CALCULATE ( SUMX ( Cost, Cost[Recovey] ), 'Calendar'[No.Month] = _nextmonth )The result will show as below:
Please check attached pbix file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Try codes as below:
1.Create a calendar table:
Calculated table:
Calendar =
ADDCOLUMNS(
CALENDAR(DATE(2020,12,01),DATE(2021,1,31)),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" )
)
create a sort column for "YearMonthnumber":
No.Month = RANKX('Calendar','Calendar'[YearMonthnumber],,ASC,Dense)
2. using lookupvalue to find the corresponding systems cost( calculated column)
Recovey = LOOKUPVALUE(Systems[Cost],Systems[System],Cost[Systems])
3.create measure to calculate next month recovery:
Next month Recovey =
VAR _nextmonth =
CALCULATE ( MAX ( 'Calendar'[No.Month] ), 'Calendar'[Date] = TODAY () ) + 1
RETURN
CALCULATE ( SUMX ( Cost, Cost[Recovey] ), 'Calendar'[No.Month] = _nextmonth )
The result will show as below:
Please check attached pbix file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.