Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi guys,
I need small help in writing DAX for below situation.
table_A
id date stagetype statustype
1042268 2020-01-27 1 1
1042268 2020-01-27 3 2
1041658 2020-01-27 2 2
1017296 2020-01-27 3 15
1042269 2020-01-27 1 1
1042270 2020-01-27 1 1
1041053 2020-01-27 3 2
1030893 2020-01-27 2 2
1030893 2020-01-27 3 2
1042271 2020-01-28 1 1
The SQL query is
select Count(DISTINCT R.id) AS 'ID'
FROM table_A R WITH(nolock)
INNER JOIN (SELECT DISTINCT SS.id,
Min(SS.date) AS MinDate
FROM table_A SS WITH(nolock)
WHERE SS.id IN (SELECT SSS.id
FROM table_A SSS WITH(nolock)
WHERE SSS.stagetype = 5
AND SSS.statustype = 4)
AND SS.statustype = 13
AND SS.stagetype = 5
GROUP BY SS.id) AS MinDate
ON R.id = MinDate.id
AND MinDate.mindate = R.date
WHERE R.id IN (SELECT DISTINCT SS.id
FROM Table_A SS WITH(nolock)
WHERE SS.id IN
(SELECT SSS.id FROM
Table_A SSS WITH (nolock)
WHERE SSS.stagetype = 5
AND SSS.statustype = 4 )
AND SS.statustype = 13
AND SS.stagetype = 5)
Actually the query using inner self join. I need DAX for above query. Please help on this.
User | Count |
---|---|
10 | |
10 | |
3 | |
2 | |
1 |