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
azaterol
Helper V
Helper V

Automatic Calculated Weeks

Hello everyone,

I would like to have the revenue for the current week displayed. If today is Wednesday, it should still be calculated from the beginning of the week, starting from Monday to Sunday.

I already have a measure called "Revenue". I would also like to have the same calculation for the upcoming week, which is in the future, starting from Monday to Sunday.

 

Hope you can help me.

Thank you.

2 REPLIES 2
amitchandak
Super User
Super User

@azaterol , You can use a measure like

 


This Week Today =
var _min = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

Last Week Today =
var _min = today() -WEEKDAY(today() ,2) -6 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank You @amitchandak ,

 

2 2uestions I have in your Code:

Why are you adding +1 at the end of _min?


This Week Today =
var _min = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

The code also works without the +1.

 

Second question is:

If I want the calculation 2 weeks ago. Do I then subtract at _min - 12 at the end? If I do this, I end up when I calculate back 12 days, I start from today (Tuesday) and end up with Wednesday 03/13/24. But why does he calculate from Monday 03/11/24? Can you explain that to me?

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.