Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ARibaudo
Regular Visitor

Cumulative sales per day and other fields

 

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 

8 REPLIES 8
kohlivinayak
Resolver I
Resolver I

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

v-yuezhe-msft
Employee
Employee

@ARibaudo,

Please share sample data of your table and post expected result here.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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:

 

usernameDateStart TimeEnd Time
a5/4/201812:00:00 AM12:00:00 AM
a5/3/201812:00:00 AM12:00:00 AM
a5/2/201812:00:00 AM12:00:00 AM
a5/1/201812:00:00 AM12:00:00 AM
a4/30/201812:00:00 AM12:00:00 AM
a4/27/201812:00:00 AM12:00:00 AM
a4/26/201812:00:00 AM12:00:00 AM
a4/25/201812:00:00 AM12:00:00 AM
a4/24/201812:00:00 AM12:00:00 AM
a4/23/201812:00:00 AM12:00:00 AM
b5/4/20186:50:00 AM3:30:00 PM
b5/3/20188:30:00 AM1:11:00 PM
b5/2/20186:30:00 AM11:45:00 AM
b5/1/201812:30:00 PM3:46:00 PM
b4/30/20186:30:00 AM4:30:00 PM
b4/27/20186:30:00 AM3:30:00 PM
b4/26/20186:30:00 AM12:30:00 PM
b4/25/20186:30:00 AM11:29:00 AM
b4/24/20186:30:00 AM10:07:00 AM
b4/23/20186:30:00 AM3:26:00 PM
c5/4/20186:00:00 AM5:15:00 PM
c5/3/20187:00:00 AM4:00:00 PM
c5/2/20186:00:00 AM3:00:00 PM
c5/1/20188:45:00 AM4:15:00 PM
c4/30/20186:00:00 AM6:00:00 PM
c4/27/20186:00:00 AM5:15:00 PM
c4/26/20186:30:00 AM6:30:00 PM
c4/25/20186:00:00 AM2:30:00 PM
c4/24/20186:30:00 AM4:30:00 PM
c4/23/20186:00:00 AM4: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

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Hi @cmullor

 

Share sample data for both the tables and the result you are expecting.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.