Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Running total with actual and forecast based on a adjustable what if-parameter

Hi all, 

 

Apologies beforehand if this question has been answered earlier. 

I have a dataset of cleared checklists (CLs) spanning from 2015 until now, and I want to display the actual RT and the actual + forecast RT. The latter is based on a series generated though the what if parameter, where I can adjust the number of CLs to see at what date the total number of CLs will be reached (around 50'000). The RT for just the actuals works fine, the problem arises when I try to combine it with the forecast RT thus I guess the problem lies with var = RT_Forecast. Also, I don't want the RT to reset per year/month/week, yet I want to display the data per week. 

Moreover, the "Checklists per week" gets multiplied by 7 in the RT_forecast column, which I assume is due to the weekly aggregativ, though I didn't have this issue in an earlier try where I narroved the dataset to only weeks in 2021. 

Below are the calculations I've used so far, any help for coding or structure would be much appreciated! 

 

Checklists per week = GENERATESERIES(0, 200, 1)
Checklists per week Value = SELECTEDVALUE('Checklists per week'[Checklists per week])

Forecast checklists per week =
var LastDateWithCL = CALCULATE(max('Checklists Actual'[Actual Date]),REMOVEFILTERS())
return
if(and(count('Checklists Actual'[Actual Date])=blank(), max('Calendar 1'[Date])>LastDateWithCL), 'Checklists per week'[Checklists per week Value],counta('Checklists Actual'[Actual Date]))
RT_Actual =
var MaxDate = MAX('Calendar 1'[Date])
var RT_Actual =
CALCULATE(
COUNTA('Checklists Actual'[Actual Date]),
FILTER(
ALLSELECTED('Calendar 1'),
'Calendar 1'[Date]<=MaxDate))
return
RT_Actual

RT_Forecast =
var MaxDate = max('Calendar 1'[Date])
var TodayDate = TODAY()
var RT_Actual =
CALCULATE(
COUNTA('Checklists Actual'[Actual Date]),
FILTER(
ALLSELECTED('Calendar 1'),
'Calendar 1'[Date]<=MaxDate))
var RT_Forecast =
CALCULATE(
SUMX(FILTER(ALLSELECTED('Calendar 1'[Date]),'Calendar 1'[Date]<=MaxDate),'Checklists per week'[Checklists per week Value]))
return
if(MaxDate<TodayDate,RT_Actual,RT_Forecast)
MarWal_0-1624437062153.png

 

Best regards,

Marte

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors