Forum Discussion
Help me fix my Variable syntax :D
Its all good. I figured it out. Just have to embed the variable within a variable.
SCP Equipment Allocation2 =
VAR SCPTotalSiteSales =
IF (
[Labour Sales] <> 0,
CALCULATE (
VAR SiteLabourSalesTotal =
CALCULATE (
[Labour Sales],
CostCentre[Facility] = "SCP NDT Services",
ScopeCodes[ScopeCodeLv2] = "Site"
) // This section calculates the total LabourSales for SCP and Site only.
RETURN
SiteLabourSalesTotal,
REMOVEFILTERS ( Sales ),
REMOVEFILTERS ( ProjectLevel ),
REMOVEFILTERS ( CostCentre ),
REMOVEFILTERS ( ScopeCodes ),
VALUES ( Dates[Month & Year] ),
VALUES ( ScopeCodes[ScopeCodeLv2] )
)
) // THis calculates the total SCP site sales against all the rows
RETURN
SCPTotalSiteSales