Forum Discussion
JulietZhu
7 years agoHelper IV
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(*...
- 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]) )
JulietZhu
7 years agoHelper IV
Tried 'Date', same error message.
Nickgastaldi
7 years agoResolver I
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])
)