Forum Discussion
pandapanda
8 years agoRegular Visitor
SQL to DAX - iterative table query
I have SQL like this select count(*) from myTABLE f1 join myTABLE f2 on f1.customerid = f2.customerid where f1.reportingdate='2017-10-31' and f2.reportingdate='2017-10-30' and f1.currentst...
- 8 years ago
It's seems someone provide a solution for your requirement on your another thread, pelase check it.
http://community.powerbi.com/t5/Desktop/Report-number-of-changes-in-a-field/m-p/310698#M137616number of users that change to currentstatus regular = VAR summizedTbl = SUMMARIZE ( yourTable, yourTable[customerid], "Distinct Status count", DISTINCTCOUNT ( yourTable[currentstatus] ), "status", CONCATENATEX ( yourTable, yourTable[currentstatus], "/", yourTable[reportingdate], DESC ) ) VAR rowCnt = COUNTROWS ( FILTER ( summizedTbl, [Distinct Status count] > 1 && LEFT ( [status], 7 ) = "Regular" ) ) RETURN IF ( ISBLANK ( rowCnt ), 0, rowCnt )Regards,
Charlie Liao
pandapanda
8 years agoRegular Visitor
Yes that is correct, but what I want in the report is to show how many users have changed to status (dynamic/slicer to choose) over a certain time perid.
in the data i give,
If I were to select the last 60 days and want to know how many users moved to status 2 then the answer I want is 2!
parry2k
Super User
8 years agobased on your sample date , answer will be 1 the scenario you explained below, no?