Forum Discussion

JulietZhu's avatar
JulietZhu
Helper IV
7 years ago
Solved

DAX help

I need convert the following sql to DAX. Basically I need count distinct taskID, which is created before 20180101 with In progress and not started status.   select count(distinct (taskID)), count(*...
  • Nickgastaldi's avatar
    Nickgastaldi
    7 years ago

    this is what you need

    taskBegDay3 = 
    VAR _selected = SELECTEDVALUE('Date'[Date (bins)],0)
    
    return
        CALCULATE (          
                     DISTINCTCOUNT(Task[TaskID])
                            ,filter(TaskStatus,TaskStatus[TaskStatus] in {"In Progress","Not Started"})
                            ,FILTER(ALL(Task), _selected > Task[createddate])
                              
                  )