Reputation: 303
I need your suggestions regarding the map visual. I have a table with a list of events. Each event has a corresponding latitude, longitude, start date, and end date. The date table has an active relationship with the start date column.
My customer's requirement is to be able to use a date slicer to select any date period, and have the map to show all the active events as per that date. When the selected date period intersects with the period between the event start date and end date, such an event should be shown on the map.
Although I can change filter context and calculate all the necessary metrics related to active events as of any arbitrary date period, I am not able to make the map show me all the active events. It only shows the events with their start date falling within the selected date period.
I tried to put the active event indicator to the map filter area (Active Events is greater than 0), but it doesn't help.
Thanks in advance for your suggestions.
Upvotes: 0
Views: 700
Reputation: 40603
You need to add a new table "Active Dates", and add a measure that filters your events as
CALCULATE(COUNTROWS('Event') //Or whatever
FILTER('Event',
NOT(ISEMPTY(
FILTER('Active Dates',
'Event'[StartDate]<='Active Dates'[Date]
&& 'Event'[EndDate]>='Active Dates'[Date]
)))))
You could also include extra logic to allow (Blank) [StartDate] and/or [EndDate], and something to exclude dates that are in the future (if these are appropriate).
If this is not efficient enough, you can change it to use MIN('Active Dates'[Date])
and MAX('Active Dates'[Date])
, rather than filtering 'Active Dates', at the cost of making your report only work if a contiguous range of dates is selected.
Upvotes: 1