Hi everyone,
I’m trying to make an adjustment in one of my reports to account for some process changes we made after a certain date. Basically exclude a certain customer’s results after a certain date.
So I have my basic measure:
Assignment Accuracy =
CALCULATE ( DIVIDE ( [Sum Ctrs Passed], [Assignments], 0 ) )
And I want to calculate the weekly results prior to (and including) 04/03/2018, which I’m doing here:
Assignment Accuracy Before 04/03/18 =
CALCULATE (
[Assignment Accuracy],
FILTER ( Dates, Dates[DateKey] <= DATE ( 2018, 03, 04 ) )
)
Then I want to calculate the results from the basic measure after 04/03/18, but exclude a customer:
Assignment Accuracy After 04/03/18 =
CALCULATE (
[Assignment Accuracy],
FILTER ( Dates, Dates[DateKey] > DATE ( 2018, 03, 04 )),Customer[Customer Code] <> "EXAMPLE")
Both of which seem to work okay.
It’s when I try to combine them back into a single measure that I run into trouble - i.e. the values for after 04/03/18 all return blank:
Assignment Accuracy Revised =
VAR SelectedDate =
SELECTEDVALUE ( Dates[DateKey], BLANK () )
RETURN
SWITCH (
TRUE (),
SelectedDate <= DATE ( 2018, 03, 04 ), [Assignment Accuracy Before 04/03/18],
SelectedDate > DATE ( 2018, 03, 04 ), [Assignment Accuracy After 04/03/18],
BLANK ()
)
I’m not using the [DateKey] value as the context, rather the Year&Week Number, but should that matter? I only have one date value per week coming from my fact table. Side note - it seems to work OK if I use the most granular dates - but this isn’t ideal for the end user.
Any ideas?