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 the above data set and i want to calculate the average in time and out time of all employee
Solved! Go to Solution.
Please check if the following DAX returns your expected result.
INTIME-avg= CALCULATE ( AVERAGEX (FILTER(Table,Table[IN/OUT]="I"&&Table[time]>=TIME(7,0,0)&&Table[time]<=TIME(11,0,0)),Table[time]), ALLEXCEPT(Table,Table[IN/OUT]))
OUTTIME-avg = CALCULATE ( AVERAGEX (FILTER(Table,Table[IN/OUT]="O"&&Table[time]>=TIME(17,0,0)&&Table[time]<=TIME(20,0,0)),Table[time]), ALLEXCEPT ( Table,Table[IN/OUT]))
Regards,
Lydia
HI @PrachiD
Try this
= CALCULATE ( AVERAGE ( TableName[Time] ), ALLEXCEPT ( TableName, TableName[empl_id], TableName[IN/OUT] ) )
Hello @Zubair_Muhammad ,
I have written the same query but the In Time should be in between 7 Am to 11 Am and the Out Time should be in the range of 5pm to 8 pm . This range I m not able to provide in the same query.
So I just have to write 2 different query with same as u have written but I should be able to provide range as well
for Intime :- 7 Am to 11 Am
for Outtime:-5pm to 8 pm
Average time I should be getting in between this given above range only
Please check if the following DAX returns your expected result.
INTIME-avg= CALCULATE ( AVERAGEX (FILTER(Table,Table[IN/OUT]="I"&&Table[time]>=TIME(7,0,0)&&Table[time]<=TIME(11,0,0)),Table[time]), ALLEXCEPT(Table,Table[IN/OUT]))
OUTTIME-avg = CALCULATE ( AVERAGEX (FILTER(Table,Table[IN/OUT]="O"&&Table[time]>=TIME(17,0,0)&&Table[time]<=TIME(20,0,0)),Table[time]), ALLEXCEPT ( Table,Table[IN/OUT]))
Regards,
Lydia
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |