Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
89 | |
77 | |
60 | |
47 | |
39 |