Forum Discussion
Alice83
1 year agoFrequent Visitor
Call Agent switching Teams
Hello everyone I am measuring different call data from two teams, 1st and 2nd level. I have Agents that changed teams and I need to show the respective data. Agent A was in Team 1st until end...
- 1 year ago
You can create a measure to use as a filter on the slicer visible.
The basic pattern is something like
Agent is visible = VAR MinDate = MIN ( 'Date'[Date] ) VAR MaxDate = MAX ( 'Date'[Date] ) VAR AgentStartDate = SELECTEDVALUE ( 'Agent'[Start date] ) VAR AgentEndDate = SELECTEDVALUE ( 'Agent'[End Date] ) VAR Result = IF ( AgentStartDate <= MinDate && ( AgentEndDate >= MaxDate || ISBLANK ( AgentEndDate ) ), 1, 0 ) RETURN ResultYou may want to tweak the logic a bit to handle cases where someone leaves part way through the year. As it is they would still be included, but you might want to exclude them.
Add the measure to the slicer as a filter, set to only show when the value is 1.
- 1 year ago
You could create another calculation item like
Agent is visible calculation item = VAR MinDate = MIN ( 'Date'[Date] ) VAR MaxDate = MAX ( 'Date'[Date] ) VAR AgentStartDate = SELECTEDVALUE ( 'Agent'[Start date] ) VAR AgentEndDate = SELECTEDVALUE ( 'Agent'[End Date] ) VAR Result = IF ( AgentStartDate <= MinDate && ( AgentEndDate >= MaxDate || ISBLANK ( AgentEndDate ) ), SELECTEDMEASURE () ) RETURN Resultand use that as a page level filter
johnt75
1 year agoSuper User
You could create another calculation item like
Agent is visible calculation item =
VAR MinDate =
MIN ( 'Date'[Date] )
VAR MaxDate =
MAX ( 'Date'[Date] )
VAR AgentStartDate =
SELECTEDVALUE ( 'Agent'[Start date] )
VAR AgentEndDate =
SELECTEDVALUE ( 'Agent'[End Date] )
VAR Result =
IF (
AgentStartDate <= MinDate
&& (
AgentEndDate >= MaxDate
|| ISBLANK ( AgentEndDate )
),
SELECTEDMEASURE ()
)
RETURN
Result
and use that as a page level filter
Alice83
1 year agoFrequent Visitor
Hi
Thank you for the calculation item. It is working on some visuals but not on all of my data. I will think on it.