Hi Thanks for your response. This is what the data looks like
This is the measure I am currently using
My objective is to calculate the total budget associated with each Workorder status however for Projected Workorders, the budget for Open and Initiated should be netted off till it gets to 0. Meaning the Budget measure would need to incorporate an adjustment for Projected Workorders
I have been able to do this successfully but the grand total does not work.
For the grand total, I am still getting a sum that reflect the original not adjusted projected budget regardless of the logic built into the measure
Below is my measure. When I use ‘HASONEVALUE’ I get 0 as the grand total
Please help
Budget =
VAR WOstatus =
FIRSTNONBLANK ( 'Projected WO'[WO_Status], 1 )
VAR BudgetTotal =
CALCULATE (
SUM ( Budget[Amount] ),
FILTER ( Budget, Budget[BudgetType] = "Budget" )
)
VAR ProjectedAmount =
CALCULATE (
BudgetTotal,
'Projected WO'[WO_Status] IN { "Projected", "projected" }
)
VAR InitiatedAmount =
CALCULATE (
BudgetTotal,
'Projected WO'[WO_Status] IN { "Initiated", "initiated" }
)
VAR OpenAmount =
CALCULATE (
BudgetTotal,
'Projected WO'[WO_Status] IN { "open", "Open" }
)
VAR AdjustedProjectedAmount = MAX( (ProjectedAmount - InitiatedAmount - OpenAmount ), 0)
RETURN
IF (
NOT ( WOstatus IN { "Projected", "projected" } ),
BudgetTotal,
AdjustedProjectedAmount)