Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Require your help in finding out time difference between two dates in the same column.
I want to know how much is the time gap between the receipts cut by a person (Objective: It is to find an anomaly between receipts cut by a person – less than one minute).
I have attached the sample data.
In excel, I used to follow below steps to find the time gap between the receipts cut by a person. I want to replicate the same using DAX measures. Is it possible to do the same without any additional columns in power pivot data model containing million rows of data (100 MB).
I wanted to replicate the same steps in power pivot. I know the step of doing it in power query (indexing and doing vlookup) but dont want to follow that method as my data size is 32 lakhs of data. It will block the memory.
So interested in doing it in DAX measures without creating any additonal columns in power pivot data model.
Please find attatched the sample data for your perusal
https://drive.google.com/folderview?id=1gZit23aVRwC5aVMTp7ohiBeSx14rwBFZ
Also can use a measure, i feel little faster loading time with this
I use this for time tracking in call center,
TimeDiff = CONVERT(SELECTEDVALUE(Table[Date1],0)-SELECTEDVALUE(Table[Date2],0),DATETIME)
Hi Kumshan450,
"
"
<--- Are collection and previous a function or a table you've created? What's "Collectedby"? In addtion, could you share your pbix file via onedrive for further analysis?
Regards,
Jimmy Tao
Sorry i am accepting solution on subtracting current row from previous row using dax measures technique not calculated column.
I am able to crack the solution by creating calculated column. However already mentioned data size is huge. Hence interest in using dax measures.
I am able to create calculated column. below is the code. Please replicate the above code using dax measure not calculated column.
Additional information, I have used rankx function to sort the data..
Then created a Time Span less than one minute column using below code.
This additional columns increases the file size. So is there any dax measures which can do do both sorting and subract current row from previous row. I heard that it is better to use dax measures than calculated column when you have one million rows of data.
DAX row context statement like earlier could not be used directly in calculate column, however, you may modify your calculate column to change to measure with formula below:
Measure = IF ( CALCULATE ( MAX ( Collectiondata[COLLECTED BY] ), FILTER ( ALL ( Collectiondata ), COUNTROWS ( FILTER ( Collectiondata, Collectiondata[Index] = EARLIER ( Collectiondata[Index] ) - 1 ) ) ) ) <> MAX ( Collectiondata[COLLECTED BY] ), 0, IF ( DATEDIFF ( CALCULATE ( MAX ( Collectiondata[COLLECTION DTM] ), FILTER ( ALL ( Collectiondata ), COUNTROWS ( FILTER ( Collectiondata, Collectiondata[Index] = EARLIER ( Collectiondata[Index] ) - 1 ) ) ) ), MAX ( Collectiondata[COLLECTION DTM] ), SECOND ) < 60, 1, 0 ) )
Regards,
Jimmy Tao
Hi Thank you very much for providing the code.
I have put your code (measure name: TS) and compared the result with the calculated column result (TS<1min). Its not matching.
Please find here the screenshot.
I have send the file data link. You can refer my previous post.
Sorry i am accepting solution on subtracting current row from previous row using dax measures technique not calculated column.
I am able to crack the solution by creating calculated column. However already mentioned data size is huge. Hence interest in using dax measures.
I am able to create calculated column. below is the code. Please replicate the above code using dax measure not calculated column.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |