YTD Actual =
Var currentitem =SELECTEDVALUE('PL'[Items])
var currentitem2 = SELECTEDVALUE('PL'[Items2])
return
SWITCH(True(),
currentitem = "Revenue",[YTD Revenue],
currentitem = "Direct Costs",[YTD COS],
currentitem = "Total GP",[YTD GP],
currentitem = "Total Margin",FORMAT([YTD Margin],"0.00%"),
currentitem = "Total Expense",[YTD Expenses],
currentitem = "EBITDA",[YTD EBITDA],
currentitem2 = "GP",CALCULATE([YTD GP],FILTER('Consolidated',Consolidated[Account Cat]=currentitem)),
currentitem2 = "Margin",FORMAT(CALCULATE([YTD Margin],FILTER('Consolidated',Consolidated[Account Cat]=currentitem)),"0.00%"),
CALCULATE([YTD Total],FILTER('Consolidated',and(Consolidated[Account Cat]=currentitem,Consolidated[PL CAT]=currentitem2))))
Now in the above measure, the text coloured in green all working, I tested all the measures in green, they all show the cumulative values. and the measure [YTD Total] also working for YTD:, the measure [YTD Total] is below:
YTD Total = CALCULATE([Total],DATESYTD(Dates[Date],"31/03"))
measure [Total] is also working as below:
Total =
var PLAmount = sum(Consolidated[Amount])*-1
var BSAmount = sum(Consolidated[Amount])
return
if(SELECTEDVALUE(Consolidated[Type])="PL",PLAmount,BSAmount)
But when I run YTD Actuals, the last line CALCULATE([YTD Total],FILTER('Consolidated',and(Consolidated[Account Cat]=currentitem,Consolidated[PL CAT]=currentitem2))) brings me the same value as periodic value, I just couldn't figure out why? surely this is just a normal sumifs statement, how come it doesn't work?
Could anyone shed light on this as it is driving me mad.