IN

IN(what-if, value)

Works out an expression in another schedule: a what-if, the baseline, or a named revision or scenario, for the same row. Everything inside IN is read in that other schedule, including names you bound outside it with LET, so do the comparing outside: WORKDAYS([Finish date], IN(BASELINE(), [Finish date])), never a variable from outside carried in.

Arguments

ArgumentWhat to give it
what-ifA schedule: WHATIF(…), BASELINE(), SCHEDULE("name"), or a LET name for one of them.
valueAny expression that gives one value for the row, read in that schedule. A list must be reduced inside it: IN(BASELINE(), MAX(Predecessors[Finish date])).

A row the other schedule doesn't have is blank: a task added since the baseline reads blank, with the reason "not in the baseline".

Examples

Formula
=IN(BASELINE(), [Finish date])

The task's baseline finish.

Formula
=WORKDAYS([Finish date], IN(WHATIF(SETTING("Data date"), ADDWORK(DATADATE(), 10d, "Standard")), [Finish date]))

How far each task moves if nothing progresses for two more weeks.

Formula
=LET(s, FILTER(All, All[Type] = "Milestone"), COUNT(FILTER(s, s[Finish date] > IN(BASELINE(), s[Finish date]))))

How many milestones now finish later than baselined. A set named outside IN is read in the other schedule member by member, lined up with the set.

Measure (on the project)
=IN(BASELINE(), SUM(Assignments[Budgeted units (entered)] * Assignments[Hourly rate]))

As a measure: the budget at completion, from the baseline's own assignments.

Reach for something else when

You wantUse
To change the schedule first, then read itWHATIF inside IN
A field as it was at each past update, not in one other scheduleHISTORY
One specific task's value, in this scheduleTask("A1000")[Finish date]: see TASK

Common questions

Why is my LET name refused inside IN?

Inside IN, everything is read in the other schedule, so a name from outside would mix the two without saying so. The editor says: “f was named outside IN, and everything inside IN is read in the what-if. Name it inside IN, or use it outside”. Read the field inside IN and compare it with this schedule's value outside.

The editor refuses this
=LET(f, [Finish date], IN(WHATIF(Task("A1000"), [Duration], 1d), f))

Why does IN refuse a list?

IN gives one value per row. The editor says: "IN gives one value per task: reduce a set or list inside it, e.g. IN(v, MAX(Predecessors[Finish date])). To read a set's field there row by row, name the set outside IN: LET(s, FILTER(All, …), IN(v, s[Finish date]))".

The editor refuses this
=IN(BASELINE(), Predecessors[Finish date])

Can I put one IN inside another?

No: "IN can't go inside another IN or inside a what-if". Read each schedule in its own IN, side by side, and combine the values outside.

Can I read a formula column inside IN?

Over the baseline or a named schedule, yes: the column is worked out on that schedule. Over a what-if, no: only built-in fields and attributes, because a what-if dates the tasks again, not your columns.