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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Creating month-to-date from weekly summarized and daily data

I'm sure this has been solved somewhere before but I couldn't find it.

 

I have a dataset of "week-to-date" timeclock hours given to me daily from our time and attendance system.

I also have a dataset of daily earned hours from our ERP.

 

For demo purposes let's say I have one department with one person in it and everything matches perfectly (I wish).

Let's say it's also currently 4/9/22 and I'm trying to pull month-to-date data.

 

Time and attendance data:

DateDayOfWeekT&A Hours
3/28/2022Monday40
3/29/2022Tuesday80
3/30/2022Wednesday120
3/31/2022Thursday160
4/1/2022Friday200
4/2/2022Saturday210
4/3/2022Sunday210
4/4/2022Monday40
4/5/2022Tuesday60
4/6/2022Wednesday100
4/7/2022Thursday140
4/8/2022Friday180

 

ERP Data

DateDayOfWeekERP Hours
3/28/2022Monday40
3/29/2022Tuesday40
3/30/2022Wednesday40
3/31/2022Thursday40
4/1/2022Friday40
4/2/2022Saturday10
4/3/2022Sunday0
4/4/2022Monday40
4/5/2022Tuesday20
4/6/2022Wednesday40
4/7/2022Thursday40
4/8/2022Friday40

 

I don't want to try to split the T&A data between 4/1 and 3/31 (the system is messy and I only fully trust a weekly summary). I want to summarize the data by: (Current Month) OR (last month and ended in a Sunday this month).

So the example data would give me

T&A = 210+180 = 390

ERP = sum of 3/28-4/8 = 390

 

Creating a measure for T&A was easy by summing where the date was in the month and either yesterday or Sunday.

However, I haven't been able to figure out a good way to make PowerBI understand the same for the ERP data as part of a measure.

I've considered importing the table a second time and creating a weekly summary as part of that import logic but I didn't really like the idea.

 

Any thoughts/suggestions? I can also provide more detail as-needed.

 

Thank you 🙂

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could add a column to your date table like

Week end month = 
var nextSunday = 'Date'[Date] - WEEKDAY( 'Date'[Date], 2 ) + 7
return MONTH(nextSunday)

then in a filter you can check for either 'Date'[Month] is the current month or 'Date'[Week end month] is the current month

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I hate when the answers are that obvious in hindsight 😆 Thank you!!

johnt75
Super User
Super User

You could add a column to your date table like

Week end month = 
var nextSunday = 'Date'[Date] - WEEKDAY( 'Date'[Date], 2 ) + 7
return MONTH(nextSunday)

then in a filter you can check for either 'Date'[Month] is the current month or 'Date'[Week end month] is the current month

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors