Forum Discussion
Unwanted Filter Back-propagation
.pbix file: https://drive.google.com/open?id=1qHiPG7lmN5dJJZhiGRrmNNBk31gyzbNG
I'm trying to have a table return all jobs that have a CurrentDate for a specific Task (task4) within a specific timeframe., >Today()-30.
Under those jobs I want to see all the HistoricalDates of specific tasks (task3 and task4).
Using CALCULATE to filter CurrentSchedule seems to unexpectedly filter the Task, even with the given crossfilter directions.
Disabing this relationship retuns expected results, however, using CROSSFILTER(CurrentSchedule[Task],Task[Task],None) to remove the relationship does not work.
So I think the issue is that you are not actually creating Job and Task filters, you are creating filters on ScheduleAudit and CurrentSchedule. Changing the expression as follows to create a list of Job IDs and Tasks seems to return the result you desire
TestMeasure2 = var JobSelection = TREATAS( CALCULATETABLE( values(CurrentSchedule[ID]), Filter(CurrentSchedule, CurrentSchedule[Task] = "task4" && CurrentSchedule[CurrentDate]> TODAY () - 30) ) , ID_Master[ID]) Var TaskSelection = TREATAS({"task3", "task4"}, Task[Task]) var result = CALCULATE ( SUM (ScheduleAudit[StartChange] ), JobSelection, TaskSelection ) return result
1 Reply
- d_gosbell
Super User
So I think the issue is that you are not actually creating Job and Task filters, you are creating filters on ScheduleAudit and CurrentSchedule. Changing the expression as follows to create a list of Job IDs and Tasks seems to return the result you desire
TestMeasure2 = var JobSelection = TREATAS( CALCULATETABLE( values(CurrentSchedule[ID]), Filter(CurrentSchedule, CurrentSchedule[Task] = "task4" && CurrentSchedule[CurrentDate]> TODAY () - 30) ) , ID_Master[ID]) Var TaskSelection = TREATAS({"task3", "task4"}, Task[Task]) var result = CALCULATE ( SUM (ScheduleAudit[StartChange] ), JobSelection, TaskSelection ) return result