Hi
I have a dataset of contracts that have varying end dates throughout the year and I want to calculate sales value into the future based on various parameters.
I’ve transformed the contract data into a row per month with salesvalue and then forecasted out to 31/12/2025 flagging whether the month is part of an existing contract or whether it is a forecast amount ([Forecast?])

So in this scenario the actual contract ended on 30/10/2021 therefore 1/11/2021 is considered a forecast whilst 1/10/2021 isn’t.

I have two what if parameters Pricing Scenario and Attrition Scenario

Based on the [Forecast?] I want to get a total by customer/contract for a given year where if [Forecast?] = N then use the [Monthly Revenue] otherwise [Monthly Revenue]Pricing Scenario less [Monthly Revenue][Attrition Scenaro]

I’ve tried various If statements / calculated columns etc but can’t get this logic to work

I’ve attached the pbix file

For eg
If Pricing Scenario = 10% and Attrition Scenario = 5% then I would expect

Line 3 to = £366.67
Line 5 to = £403.33 - 18.33 result £385

For my understanding Is the selectedvalue performing the same function of an iterating function in this case ie it’s going through the table and each row is deemed selected and therefore evaluated?

Thanks to Harsh the following seemed to work - which is different to yours.
What is the ISINSCOPE adding? Is your version more robust than this one or are they both doing exactly the same thing?
Thanks for your help so far
Total Forecast - Totals =
SUMX(
SUMMARIZE(
ContractDataTest ,
ContractDataTest[new_contractno] ,
ContractDataTest[Forecast Out] ,
ContractDataTest[Forecast?] ,
ContractDataTest[Forecast Month] ,
“@Totals” ,
[Total Forecast] ) ,
[@Totals]
)

Both measure are doing the same thing.
The only difference is that Harsh apply his formula every time, whereas I apply my formula only for the totals and I keep the initial measure for the rows.

So ISINSCOPE allow me to see if in the context I have a filter on [Forecast Month] and in the total it is not the case