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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ptown
Helper I
Helper I

Timesheet Report - Need to generate data to highlight missing timesheets for weeks no data submitted

Hi, thanks in advance to anyone who can help me with the following.

 

I have created a report that shows data from a SharePoint weekly timesheet system. My report is fully working apart from one shortfall: If a person does not submit a timesheet for a given week the timesheet system does not generate an entry to say there is a missing timesheet.

 

I'm trying to get the PBI report to create an entry to flag the missing timesheet but I've been struggling with the challenge thus far.

 

I have a table of employees with the dates they started working for the company. And with the end dates for any people that have left the company. Everyone should submit at least one entry every week. (Even if it's just an entry to say they were on vacation).

 

And I have a table of entries by week. One person can submit multiple rows for the same week (i.e. one for each activity they do). But if they submit nothing (for a week when they are employed by the company) I need the report to generate a row for them. This row should have activity equal to "Missing Timesheet" and have a set number of hours assigned to it (for simplicity it could just be 7 hours per day, ideally it would be 7 hours on weekdays and 0 on weekends).

 

I have created a dummy pbix file with dummy data. You will notice that

  • Carl has not submitted anything for week commencing 10th October. Therefore I need to generate the "Missing Timesheet" entry for Carl for this week.
  • Bryony leaves the company on 23rd Oct. So the fact she doesn't submit a timesheet for week commencing 24th Oct is expected. Nothing needs to be generated.
  • Dora joins the company on 24th Oct. Nothing needs to be generated for her for the previous weeks.

 

Here are some screeshots from that dummy file:

 

Timesheet_people.PNG

 

 


timesheet_entries.PNG

 

 

 

Ptown_0-1667322507716.png

 

Thanks again for any help or guidance.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ptown ,

 

According to your description, here are my steps you can follow as a solution.

(1)First, create a calculated column [Person_leave_date1] in the [employees] table.

Person_leave_date1 =
IF(ISBLANK('Employees'[Person_leave_date]),TODAY(),'Employees'[Person_leave_date])

(2)Then create a calculated table [Table].

Table =

var _employee=SUMMARIZE('Employees','Employees'[Person_Name])

var _date=SUMMARIZE('Timesheets','Timesheets'[Week Commencing])

var _crossjoin=CROSSJOIN(_employee,_date)

return

FILTER(_crossjoin,[Week Commencing]>=MAXX(FILTER('Employees','Employees'[Person_Name]=EARLIER([Person_Name])),'Employees'[Person_start_date])&&[Week Commencing]<=MAXX(FILTER('Employees','Employees'[Person_Name]=EARLIER([Person_Name])),'Employees'[Person_leave_date1]))

(3) Then create a calculated column [Flag] in the [Table] table.

Flag =

var _date=SUMMARIZE(FILTER('Timesheets','Timesheets'[Person_Name]=EARLIER('Table'[Person_Name])),Timesheets[Week Commencing])

return

IF([Week Commencing] in _date,0,1)

(4)Then create a calculated table [Timesheets1].

Timesheets1 =

var _append= SELECTCOLUMNS(FILTER('Table','Table'[Flag]=1),"Unique_Ref","Ref-missing","Person_Name",[Person_Name],"Week Commencing",[Week Commencing],"Activity","Missing Timesheet","Monday",7,"Tuesday",7,"Wednesday",7,"Thursday",7,"Friday",7,"Saturday",0,"Sunday",0,"cc_WeekHours",35)

return

UNION('Timesheets',_append)

(5) Then the result is as follows.

vtangjiemsft_0-1667382251735.png

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
BayanKhalaf
Regular Visitor

Hello @Ptown 
how did you create the report? am trying to create the same report but i can't find a way to get the data or export it from sharepoint

Anonymous
Not applicable

Hi @Ptown ,

 

According to your description, here are my steps you can follow as a solution.

(1)First, create a calculated column [Person_leave_date1] in the [employees] table.

Person_leave_date1 =
IF(ISBLANK('Employees'[Person_leave_date]),TODAY(),'Employees'[Person_leave_date])

(2)Then create a calculated table [Table].

Table =

var _employee=SUMMARIZE('Employees','Employees'[Person_Name])

var _date=SUMMARIZE('Timesheets','Timesheets'[Week Commencing])

var _crossjoin=CROSSJOIN(_employee,_date)

return

FILTER(_crossjoin,[Week Commencing]>=MAXX(FILTER('Employees','Employees'[Person_Name]=EARLIER([Person_Name])),'Employees'[Person_start_date])&&[Week Commencing]<=MAXX(FILTER('Employees','Employees'[Person_Name]=EARLIER([Person_Name])),'Employees'[Person_leave_date1]))

(3) Then create a calculated column [Flag] in the [Table] table.

Flag =

var _date=SUMMARIZE(FILTER('Timesheets','Timesheets'[Person_Name]=EARLIER('Table'[Person_Name])),Timesheets[Week Commencing])

return

IF([Week Commencing] in _date,0,1)

(4)Then create a calculated table [Timesheets1].

Timesheets1 =

var _append= SELECTCOLUMNS(FILTER('Table','Table'[Flag]=1),"Unique_Ref","Ref-missing","Person_Name",[Person_Name],"Week Commencing",[Week Commencing],"Activity","Missing Timesheet","Monday",7,"Tuesday",7,"Wednesday",7,"Thursday",7,"Friday",7,"Saturday",0,"Sunday",0,"cc_WeekHours",35)

return

UNION('Timesheets',_append)

(5) Then the result is as follows.

vtangjiemsft_0-1667382251735.png

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Thank you, that is fantastic and does exactly what I need. The concept makes perfect sense & the act of transferring this to my real model will give me the opportunity to fully understand each component.

 

FYI In your step 4 I changed "Ref-missing" to the following:

"RefM-" & CONCATENATE(FORMAT([Week Commencing],"yyyy-MM-dd-"),[Person_Name])
So that my Unique_Ref column will continue to have unique entries no matter how many missing timesheets there may be.
 
Thanks again!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.