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.
Hello All,
I have swipe card details table as below
Here i would like to calculate the time duration from In and out each time.
Here in above image we need to get the time duration from 1st I01 to 1st O01 like wise for every In and Out.
But at last I01 theres no Out, so here from that In time to current time calculate the time duration.
How can i calculate the time duration.
Any suggestion please
Mohan V
Solved! Go to Solution.
@Anonymous
Try this
= VAR OutTime = CALCULATE ( MIN ( TableName[Time] ), FILTER ( TableName, TableName[Time] > EARLIER ( TableName[Time] ) && TableName[Employee Name] = EARLIER ( TableName[Employee Name] ) && TableName[In/Out] = "O01" ) ) VAR Endtime = IF ( ISBLANK ( OutTime ), NOW (), OutTime ) RETURN IF ( TableName[In/Out] = "I01", DATEDIFF ( TableName[Time], EndTime, MINUTE ) )
Hi @Anonymous
Try this column
= VAR OutTime = CALCULATE ( MIN ( TableName[Time] ), FILTER ( TableName, TableName[Time] > EARLIER ( TableName[Time] ) && TableName[In/Out] = "O01" ) ) VAR Endtime = IF ( ISBLANK ( OutTime ), NOW (), OutTime ) RETURN IF ( TableName[In/Out] = "I01", DATEDIFF ( TableName[Time], EndTime, MINUTE ) )
I have tried what you have suggested.
but it is not giving me the right output
Can you please help me to get this done..
It will help me a lot.
Thank you.
Mohan V
@Anonymous
Try this
= VAR OutTime = CALCULATE ( MIN ( TableName[Time] ), FILTER ( TableName, TableName[Time] > EARLIER ( TableName[Time] ) && TableName[Employee Name] = EARLIER ( TableName[Employee Name] ) && TableName[In/Out] = "O01" ) ) VAR Endtime = IF ( ISBLANK ( OutTime ), NOW (), OutTime ) RETURN IF ( TableName[In/Out] = "I01", DATEDIFF ( TableName[Time], EndTime, MINUTE ) )
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |