I want to be able to limit a KPI, let's say turnover, to a specific time range which I chose by setting two variables: the lower bound and the upper bound.
I have created two tables, which I derive from the calendar-table.
month_start:
LOAD MonthYear as MonthStart
RESIDENT Calendar;
month_end:
LOAD MonthYear as MonthEnd
RESIDENT Calendar;
I create two filters, one for MonthStart and one for MonthEnd.
I set two variables. I know that GetFieldSelections()
returns a string so I convert it back to a date.
=date#(GetFieldSelections(MonthEnd), 'MM YYYY')
=date#(GetFieldSelections(MonthStart), 'MM YYYY')
Finally I use this expression to calculate the KPI:
SUM({$< MonthYear = {"<$(=vEndMonth)>=$(=vStartMonth)"}>} [turnover])
But it doesn't work. The measure returns 0,00€ (the data is definitly there though).
What am I doing wrong? What am I missing?