Forum Discussion
Editing and cleaning data
Anonymous Follow below steps. I have created sample dataset similar to yours.
1. Go to query editor and make sure TimeIn and TimeOut columns are declared as Time under Data Type.
2. Select TimeIn TimeOut columns and click Unpivot columns which will give you result columns as below.
3. Add Index column under Add Column tab and exit Query Editor by Close&Apply.
4. Finally add custom column using below DAX code to get difference in minutes.
Difference = 24. * 60 *(IF( 'sam'[Index] = 0, sam[Value], LOOKUPVALUE( 'sam'[Value], 'sam'[Index], 'sam'[Index]-1) ) - sam[Value])
Dear Ankit,
Thanks for your quick reply,But I fear the solution is not what I need.Please see the punchrecords data in my source,I need to transform those comma seperated values and from those time in time out I need to find the intervals.
Regards
Rishi
- v-caliao-msft10 years agoMicrosoft Employee
Anonymous
I don't think there is a functionally to transform those comma seperated values and from those time in time out directly. You'd better to tranfer it in ETL tools and then display the data in Power BI.