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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
OntheDAXside
Frequent Visitor

Total hours for previous week and current week

 
Please I need help.

 

I have a data set and need to always calculate total hours for this week and previous week by refreshing the SQL data. I have used current week offset on my Calendar to get sum of this week and previous week using calculate function. Calculate([hours],'calendar', [curweekoffset]=0) what I need is the total sum of hours from inception to current week and previous week.

 

Thank you in anticipation.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @OntheDAXside ,

To get the total sum of hours from inception to the current week and previous week, you can modify your existing formula to include an additional filter condition that selects all weeks up to and including the current week and the previous week. Here's an example of how you can modify your formula:

Calculate([hours],'calendar', [curweekoffset]<=0 && [curweekoffset]>=-1)

This will calculate the sum of hours for all weeks where the current week offset is less than or equal to 0 ( the current week and all previous weeks) and greater than or equal to -1 (i.e., the previous week).

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

2 REPLIES 2
OntheDAXside
Frequent Visitor

Thank you @Anonymous 

Anonymous
Not applicable

Hi @OntheDAXside ,

To get the total sum of hours from inception to the current week and previous week, you can modify your existing formula to include an additional filter condition that selects all weeks up to and including the current week and the previous week. Here's an example of how you can modify your formula:

Calculate([hours],'calendar', [curweekoffset]<=0 && [curweekoffset]>=-1)

This will calculate the sum of hours for all weeks where the current week offset is less than or equal to 0 ( the current week and all previous weeks) and greater than or equal to -1 (i.e., the previous week).

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.