Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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.
Solved! Go to Solution.
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.
Thank you @Anonymous
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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 51 | |
| 41 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 134 | |
| 111 | |
| 50 | |
| 31 | |
| 29 |