cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ARibaudo Frequent Visitor
Frequent 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
Moderator v-yuezhe-msft
Moderator

Re: Cumulative sales per day and other fields

@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.
ARibaudo Frequent Visitor
Frequent Visitor

Measuring Intervals

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

Moderator v-yuezhe-msft
Moderator

Re: Measuring Intervals

@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.

Re: Cumulative sales per day and other fields

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 Frequent Visitor
Frequent Visitor

Re: Measuring Intervals

I didn't include it.  It is a separate table [Employee List] that shows hourly pay rates

Re: Measuring Intervals

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.

cmullor Frequent Visitor
Frequent Visitor

Re: Measuring Intervals

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

Re: Measuring Intervals

Hi @cmullor

 

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors