This worked for me -
ClearCollect(
Demo123,
ForAll(
Distinct(
TestList,
Batch
),
{
Batch: Value,
Result: Average(
ForAll(
Distinct(
Filter(
TestList,
Batch = Value,
Month(Date) = Month(ThisRecord.Date)
),
Batch & "," & Month(Date) & Year(Date)
),
{
Date: ThisRecord.Value,
MonthAvg: (Sum(
Filter(
TestList,
Month(Date) & Year(Date) = Last(Split(Value,",")).Value,
Batch = First(Split(Value,",")).Value
),
Rating
) / CountRows(
Filter(
TestList,
Month(Date) & Year(Date) = Last(Split(Value,",")).Value,
Batch = First(Split(Value,",")).Value
)
))
}
),
MonthAvg
)
}
)
);
Set(GPA, Round(Average(Demo123,Result),2));