Hello PowerPivot and DAX experts,
I'm sorry that I can't attached images or links since my account still awaits to verify.
Say for example I have a slicer name 'City', and their city names are 'Toronto', 'Ottawa' and 'Vancouver'.
Out of these cities, there's properties that are related to them, and these properties, some are December Year end, some are April Year end and some are August Year end.
I had a measure [Final Figures] that calculates correctly. I am now trying to create a simple [MTD Actual], [MTD Budget], [YTD Actual] and [YTD Budget] measures that uses [Final Figures].
For example [MTD Actual]:
IF(HASONEVALUE(tblCommunity[Year End]),
SWITCH(VALUES(tblCommunity[Year End])
,
"Apr", CALCULATE([Final Figures],
ActualBudget[Actual/Budget] = "Actual",
FILTER(ALL('Calendar DateTable'),
'Calendar DateTable'[Month Index] = VALUE(MAX('Calendar
DateTable'[Month Index])) - 4 && 'Calendar DateTable'[Year] = MAX('Calendar DateTable'[Year])
)
)
,
"Dec", CALCULATE([Final Figures],
ActualBudget[Actual/Budget] = "Actual"
)
)
)
The above [MTD Actual] formula works ONLY when the properties that are retrieved via 'City slicer' ONLY has 1 Year End value that is either December Year End, or April Year End. But when there's multiple Year End properties in the same city, my [MTD Actual]
calculation becomes blank.
May I ask then, how can I 'sum' both of the Year End properties by 'checking' these properties are 'Apr Year End', and these properties are 'Dec Year End' and then sum them up when there's multiple Year End properties vs. only 1 Year End property.