Forum Discussion

pbi1908's avatar
pbi1908
Helper III
3 years ago
Solved

Measure doesn't recognize the date filter

Hi everyone, 

 

I would like to calculate the DISTINCTCOUNT of the Tasks when the EndDATE was before today. 

 

I am trying the folloing code but for some reason the filter is not working and i can't understnad why. 

If i implement the filter directly in the visual i get the correct number but with the measure i am not able.

 

Task Count = 

VAR TaskCount  = DISTINCTCOUNT(Assignments[TaskId])
RETURN
EXPIRE= CALCULATE(TaskCount,Tasks[TaskFinishDate]<TODAY())
 
  • Try it like this.

     

    TaskCount = CALCULATE(DISTINCTCOUNT(Assignments[TaskId]),Tasks[TaskFinishDate]<TODAY())

    Variables are not affected by CALCULATE.

     

1 Reply

  • Try it like this.

     

    TaskCount = CALCULATE(DISTINCTCOUNT(Assignments[TaskId]),Tasks[TaskFinishDate]<TODAY())

    Variables are not affected by CALCULATE.