Forum Discussion
LuisCaston82
2 years agoNew Member
Switch and add a result
Dear all,
I've this formula:
Actual YTD + Forecast =
var _YTD = CALCULATE([Amount], BIFRF000[Report] = "", BIFRF000[Period Type] = "T", BIFRF000[Type] = "V")
var _Forecast = CALCULATE([Amount], BIFRF000[Report Type] = "T")
RETURN
SWITCH(
TRUE,
_YTD = "", _YTD,
_YTD <> "", _Forecast)
The goal is like this:
The goal is like this:
November and december is blank so is applying forecast, is correct.
Junuaty to October is real but is summing Actual + Forecast and is not correct, must be only real because _YTD has result.
Do you know how can I do it?
LuisCaston82
Please try this measure:Actual YTD + Forecast = VAR _YTD = CALCULATE ( [Amount], BIFRF000[Report] = "", BIFRF000[Period Type] = "T", BIFRF000[Type] = "V" ) VAR _Forecast = CALCULATE ( [Amount], BIFRF000[Report Type] = "T" ) RETURN IF ( _YTD = 0, _Forecast, _YTD )
2 Replies
- Fowmy
Super User
LuisCaston82
Please try this measure:Actual YTD + Forecast = VAR _YTD = CALCULATE ( [Amount], BIFRF000[Report] = "", BIFRF000[Period Type] = "T", BIFRF000[Type] = "V" ) VAR _Forecast = CALCULATE ( [Amount], BIFRF000[Report Type] = "T" ) RETURN IF ( _YTD = 0, _Forecast, _YTD ) - LuisCaston82New Member