I'm trying to add a condition to GroupBy, but I get an error saying: The function GroupBy has some invalid arguments. Expected literal text. We expect literal text at this point in the formula. I really don't know what I'm missing. I'm trying to use something like this:
...
GroupBy(
Data,
If(
condition,
"Column1",
"Column2"
)
)
...
The code I'm using is this:
ClearCollect(
reportsDataTypeByYear,
AddColumns(
SortByColumns(
GroupBy(
AddColumns(
rawData,
"ROValue",
'Office'.Value
),
If(reportTypeVar = "Count By Request Type And FY","fy", "Title"),
"ROValue",
"ROGroup"
),
"ROValue",
Ascending
),
"TypeCount",
CountRows(ROGroup)
)
)
Thanks for any suggestion.