I am using a filter to extract records from a Dataverse Table and then to Sum the column 'Proj Value ($)'
When I use the following formula, it works correctly:
Text(
Sum(
Filter(
Projects,
'OP Status Change Date' >= Date(
Year(Today()),
1,
1
),
'OP Status Change Date' <= DateAdd(
Date(
Year(Today()),
1,
1
),
1,
Years
),
'OU and Salesperson'.'OU Region' = galManagers.Selected.Region,
'Opportunity Status'.'Dashboard Sold' = "yes"
),
'Proj. Value ($)'
),
"[$-en-US]$#,###.00"
)
When I use With in the formula, it retrieves an incorrect value:
With(
{
StartDate: Date(
Year(Today()),
1,
1
),
EndDate: DateAdd(
Date(
Year(Today()),
1,
1
),
1,
Years
)
},
Text(
Sum(
Filter(
Projects,
'OP Status Change Date' >= StartDate,
'OP Status Change Date' <= EndDate,
'OU and Salesperson'.'OU Region' = galManagers.Selected.Region,
'Opportunity Status'.'Dashboard Sold' = "yes"
),
'Proj. Value ($)'
),
"[$-en-US]$#,###.00"
)
)
Can anyone see where I am going wrong in the use of With?
Thanks!