Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I am trying to calculate the hours worked per month for every employee. This is based on a Sharepoint list. Their usernames go into the title column, then the ActivityType column details what they did (Check In, Lunch Out, Lunch In, Check Out) and ActivityDateTime details the exact time they did such activity. Is there any way I can calculate the time between Check In and Check Out within the same column? If I create a column for each activity type I'll have to redo the entire Canvas App that I have for time tracking that uses this list as data source.
Solved! Go to Solution.
Hi @vinidegrandi ,
Try below formula:
time_diff =
var Check_In = calculate(max([activitydatetime]), filter(yourtable,[activitytype]=earlier([activitytype])-1))
Return
datediff(Check_In,[activitydatetime],HOUR)
@vinidegrandi
Your ActiveType is a "Text" type. Please change its type to "Number" then you could use the DAX above.
Best Regards.
Hi @vinidegrandi ,
Try below formula:
time_diff =
var Check_In = calculate(max([activitydatetime]), filter(yourtable,[activitytype]=earlier([activitytype])-1))
Return
datediff(Check_In,[activitydatetime],HOUR)
Its displaying an error saying that the DAX comparison does not offer support for a comparison between a number and a text. Its suggesting using VALUE or FORMAT.
@vinidegrandi
Your ActiveType is a "Text" type. Please change its type to "Number" then you could use the DAX above.
Best Regards.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |