Forum Discussion
Average and Forecasting
- 9 years ago
Hi edson_souza,
Create the following measures:
Forecast_Total = IF ( SUM ( Average_Forecast[Realized] ) = 0; CALCULATE ( [Average realized]; ALLSELECTED ( Average_Forecast ) ); SUM ( Average_Forecast[Realized] ) )Forecast = IF ( SUM ( Average_Forecast[Realized] ) = 0; CALCULATE ( [Average realized]; ALLSELECTED ( Average_Forecast ) ); SUMX ( SUMMARIZE ( Average_Forecast; Average_Forecast[Month]; "Forecasted"; Average_Forecast[Forecast_Total] ); [Forecasted] ) )The first one is just auxiliary to calculate the total value for the year, then just add the Forecast to your table should give expected result.
Regards,
MFelix
Hi MFelix
I tested it this way, but the unrealized month continues with a value equal to 0.00.
I noticed in your table "Average realized" has value in every month, mine only where realized.
I was able to apply the monthly average, but when I put the IF (Realized = 0; Average; Realized) the TOTAL does not add all the values.
How can I do it?
Note that the Forecast total is the same as Realized, but should also add up to 644,821.53, with the result equal to 7,737,858.41.
- MFelix9 years agoSuper User
Hi edson_souza,
Create the following measures:
Forecast_Total = IF ( SUM ( Average_Forecast[Realized] ) = 0; CALCULATE ( [Average realized]; ALLSELECTED ( Average_Forecast ) ); SUM ( Average_Forecast[Realized] ) )Forecast = IF ( SUM ( Average_Forecast[Realized] ) = 0; CALCULATE ( [Average realized]; ALLSELECTED ( Average_Forecast ) ); SUMX ( SUMMARIZE ( Average_Forecast; Average_Forecast[Month]; "Forecasted"; Average_Forecast[Forecast_Total] ); [Forecasted] ) )The first one is just auxiliary to calculate the total value for the year, then just add the Forecast to your table should give expected result.
Regards,
MFelix
- edson_souza9 years agoRegular Visitor
Perfect, MFelix.
Thank you very much for your help, see you soon.