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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
warrenpoh
Frequent Visitor

Data Modeling with Timesheets

Hi,

 

I am trying to model some timesheet data that both looks at the timesheet transactions themselves AND compares and creates metrics using information not in the transactions table.

 

Ideal Output

 

StaffName   |  Hours Meant to Have Worked YTD    |   Hours Worked TOTAL YTD |  Invoiced TOTAL YTD |       Invoiced/Hours Meant to have worked YTD

 

This is for lots of staff.

 

I have a transaction table that has data such as:

 

Staff Name | Transaction Date | Hours Worked | Invoiced Value

 

I then do a CALCULATE(SUM( etc.) to get the hours worked for each staff member and the total invoiced value.  Essentially I can get what I want with the 'history data'.  E.g I can get the Invoiced Total and divide by the Hours Worked Total which gives me the hourly rate for the year.  But what I want to do is calculate the Invoiced Total and divide by the Hours Meant to have Worked Total (e.g. the hours they shoudl have worked - reflects overtime better etc.)

 

I have created tables with 'dummy' data transactions that allows me to sum the hours meant to have worked for each staff member but I can't get a relationship to work between the tables as they are many:many... I've tried SUMMARIZECOLUMNS to try and get a psuedo pivot table with the dummy data but no luck.

 

I need help!

 

Thanks

1 ACCEPTED SOLUTION
v-caliao-msft
Microsoft Employee
Microsoft Employee

Hi @warrenpoh,

 

You can create a table using the DAX below.

Summrize = SUMMARIZE(STALL,STALL[StaffName])

 

Then add some calculated column like:Hours Worked TOTAL YTD = CALCULATE(SUM(STALL[HoursWorked]),FILTER(ALL(STALL),STALL[StaffName]='Summrize'[StaffName]))Invoiced TOTAL YTD = CALCULATE(SUM(STALL[InvoicedValue]),FILTER(ALL(STALL),STALL[StaffName]='Summrize'[StaffName]))

Capture.PNG

 

If this is not what you want, please provide us more information, if possible provide us some cample data and screenshots, so that we can make further analysis.

 

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Microsoft Employee
Microsoft Employee

Hi @warrenpoh,

 

You can create a table using the DAX below.

Summrize = SUMMARIZE(STALL,STALL[StaffName])

 

Then add some calculated column like:Hours Worked TOTAL YTD = CALCULATE(SUM(STALL[HoursWorked]),FILTER(ALL(STALL),STALL[StaffName]='Summrize'[StaffName]))Invoiced TOTAL YTD = CALCULATE(SUM(STALL[InvoicedValue]),FILTER(ALL(STALL),STALL[StaffName]='Summrize'[StaffName]))

Capture.PNG

 

If this is not what you want, please provide us more information, if possible provide us some cample data and screenshots, so that we can make further analysis.

 

Regards,

Charlie Liao

Thanks Charlie

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors