Hello Henning, I have found the root cause of the issue.
It's below member formula where I want to have a translation to USD done in the account formula, here the entity has functional currency USD. When this runs the first time the value becomes a calculated value, second time it is set to zero. I will make the exclusion on entity, not on consolidation currency.
Dim Targetcur As String = api.Entity.GetLocalCurrency(api.Pov.Entity.MemberId).Id
Dim SourceEntcur As String = "176"
Dim AvgRate As String = api.FxRates.GetCalculatedFxRate(api.FxRates.GetFxRateTypeForRevenueExp().Name.ToString, api.Pov.Time.MemberId,SourceEntcur, Targetcur).XFToStringForFormula
If (Not api.Entity.HasChildren()) And api.Pov.Cons.Name.Equals("USD") And (Not api.Entity.GetLocalCurrencyId.Equals ("USD"))
If Not AvgRate = 0 Then
api.Data.Calculate("C#USD = C#Local /" & AvgRate, accountFilter:="A#BalRecurAccs_PRICE.base")
End If
End If