So I have tried the above and my Parent Gallery is a bit more complex as it has a sortbycolumns, groupby and a filter on it. So the formula in the parent looks thus
GroupBy(SortByColumns(Filter(AddColumns(ColVROM,"PType",Name),PType = Dropdown2.SelectedText.Value),"field_1",["Initiate", "Define & Design", "Build & Deliver", "Closure"]),"field_1","DATA")
The Child gallery is then run from ThisItem.data
The formula that runs on selection of the check box then looks like this. Note that it also runs a calculation to work out the amount of working days between 2 dates, that are stored at the Parent gallery level it then runs another calculation to work out how much it would cost a day.
Collect(colVROMsub,{
Title: TextInput7.Text,
ResourceType: ThisItem.Skill,
FTE: Value(TextInput6.Text),
StartDate: DatePicker3_1.SelectedDate,
EndDate: DatePicker3.SelectedDate,
Stage: Label19.Text ,
ProjectSize:Dropdown2.SelectedText.Value,
TotalDays: Value(With(
{
// generate a one-column table of all dates between start date & end date
varDateRange: ForAll(
Sequence(DatePicker3.SelectedDate - DatePicker3_1.SelectedDate + 1),
DatePicker3_1.SelectedDate + Value - 1
)
},
If(
And(
IsBlank(DatePicker3_1.SelectedDate),
IsBlank(DatePicker3.SelectedDate)
),
// show nothing if any date pickers are blank
0,
// include only dates Monday to Friday
CountIf(
varDateRange,
Weekday(Value) in [2, 3, 4, 5, 6]
)
)
))* Value(TextInput6.Text),
Cost: Value(With(
{
// generate a one-column table of all dates between start date & end date
varDateRange: ForAll(
Sequence(DatePicker3.SelectedDate - DatePicker3_1.SelectedDate + 1),
DatePicker3_1.SelectedDate + Value - 1
)
},
If(
And(
IsBlank(DatePicker3_1.SelectedDate),
IsBlank(DatePicker3.SelectedDate)
),
// show nothing if any date pickers are blank
0,
// include only dates Monday to Friday
CountIf(
varDateRange,
Weekday(Value) in [2, 3, 4, 5, 6]
)
)
))* Value(TextInput6.Text)*400
}
)
maybe i have gone overcomplex?