Using a measure, I am trying to return a previous months data. I have a month slicer and when selecting June for example, the measure is returning June's data not May's.
Here is the measure:
Prior months contact rate =
CALCULATE(
[Offline Contact Rate],
PREVIOUSMONTH('DIM - Date'[date_worked])
)
The offline contact rate measure simply finds the percentage of a number by dividing some filtered rows by the whole data set.
The offline contact rate uses data from the main table and the 'Dim - Date' table is a separate table which is marked as a date table. The two tables are linked using the 'date_worked' column which they both have.
Offline contact rate measure:
Offline Contact Rate =
DIVIDE(
CALCULATE(
COUNTROWS('main_table'),
FILTER(
'main_table',
'main_table'[worktype]="Offline"
&& 'main_table'[contact_reason]="Further information"
)
),
CALCULATE(
COUNTROWS('main_table'),
FILTER(
'main_table',
'main_table'[worktype]="Offline"
)
)
)