Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I've got a table that has start and stop times by employee, hourly rate, and location.
I'd like to calculate my employee cost (in 15 minute increments) throughout the day. As a caveat, there are different start and stop times throughout the day, i.e. people clock in differently
Hi @ARibaudo
I first concatenated your date and time
then converted it to date time from modeling
and figured out difference in time, in minutes, with datediff
divide the value with 15 and round up now multiply this with unit pay amount
all of this done in columns so you can sum up easily.
Start Dt_Time = Table1[Date] & " " & Table1[Start] // for concatination
@ARibaudo,
Please share sample data of your table and post expected result here.
Regards,
Lydia
My apologies, the title should be Measuring Intervals - not sure how that happened.
These are the steps I followed but can't figure out how to do it by date:
Step 1) built an [Times] Table that has all the intervals in 15 minute increments,
Interval |
0:00:00 |
0:15:00 |
0:30:00 |
0:45:00 |
1:00:00 |
Existing [Data] Table that has username, date (not unique value), start time, stop time:
username | Date | Start Time | End Time |
a | 5/4/2018 | 12:00:00 AM | 12:00:00 AM |
a | 5/3/2018 | 12:00:00 AM | 12:00:00 AM |
a | 5/2/2018 | 12:00:00 AM | 12:00:00 AM |
a | 5/1/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/30/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/27/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/26/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/25/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/24/2018 | 12:00:00 AM | 12:00:00 AM |
a | 4/23/2018 | 12:00:00 AM | 12:00:00 AM |
b | 5/4/2018 | 6:50:00 AM | 3:30:00 PM |
b | 5/3/2018 | 8:30:00 AM | 1:11:00 PM |
b | 5/2/2018 | 6:30:00 AM | 11:45:00 AM |
b | 5/1/2018 | 12:30:00 PM | 3:46:00 PM |
b | 4/30/2018 | 6:30:00 AM | 4:30:00 PM |
b | 4/27/2018 | 6:30:00 AM | 3:30:00 PM |
b | 4/26/2018 | 6:30:00 AM | 12:30:00 PM |
b | 4/25/2018 | 6:30:00 AM | 11:29:00 AM |
b | 4/24/2018 | 6:30:00 AM | 10:07:00 AM |
b | 4/23/2018 | 6:30:00 AM | 3:26:00 PM |
c | 5/4/2018 | 6:00:00 AM | 5:15:00 PM |
c | 5/3/2018 | 7:00:00 AM | 4:00:00 PM |
c | 5/2/2018 | 6:00:00 AM | 3:00:00 PM |
c | 5/1/2018 | 8:45:00 AM | 4:15:00 PM |
c | 4/30/2018 | 6:00:00 AM | 6:00:00 PM |
c | 4/27/2018 | 6:00:00 AM | 5:15:00 PM |
c | 4/26/2018 | 6:30:00 AM | 6:30:00 PM |
c | 4/25/2018 | 6:00:00 AM | 2:30:00 PM |
c | 4/24/2018 | 6:30:00 AM | 4:30:00 PM |
c | 4/23/2018 | 6:00:00 AM | 4:30:00 PM |
Step 2)
Expanded Table = SELECTCOLUMNS(
FILTER(
CROSSJOIN(Data,Times),
[Start Time]<='Times'[Interval]
&& 'Data'[End Time] >'Times'[Interval]
),
"Employee",[username],
"Time Inteval",[Interval],
"Total Pay",[Pay]
)
The problem is I can't seem to get it to slice by date. Thanks, Andrew
@ARibaudo,
Where is Pay field in your table? Calculated table will not response to slicers. See https://community.powerbi.com/t5/Community-Knowledge-Base/Calculated-Column-Table-Change-Dynamically... .
Regards,
Lydia
I didn't include it. It is a separate table [Employee List] that shows hourly pay rates
Making a relationship between two tables on employee code/ name should work.
If not pls share your tables structure with sample data and expected output.
Hi I am new to Power BI as well and have a very similar questions. I am trying to link my hourly sales to the hourly labor expense. The labor information that I have comes as follows:
Date Name Clock In Time Clock out Time
Do you how I can be able to do this ?
Thank you