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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jnnilesh29
Helper III
Helper III

Sum of Value of Current Week to Next 3 Weeks

Hi All,

 

I'm trying to write a DAX code to calculate the sum of values between current week to next 3 weeks.

I have written the following DAX code:

 

Hours for next 3 weeks = 
CALCULATE(SUM('Resource Management'[Hours]),DATESINPERIOD('Calendar'[Date],TODAY(),28,DAY))

 

However, the above code does not take the current week values in consideration.

The example is below where the graph is showing the current result but not the table and ignoring the current week values:

jnnilesh29_0-1603221161849.png

I have the weekday column in my sheet as shown below:

jnnilesh29_1-1603221244848.png

Could you please help me to write a current DAX code?

 

Your help is appreciated.

 

Thanks,

Nilesh

1 ACCEPTED SOLUTION

For someone who is looking for the solution for the sum of values between the current week to the next 3 weeks:

Hours for next 3 weeks = 
CALCULATE
(SUM('Resource Management'[Hours]),
FILTER(ALL('Resource Management'[WEEK NUMBER]),
'Resource Management'[WEEK NUMBER]>=WEEKNUM(TODAY(),1) && 'Resource Management'[WEEK NUMBER]<=WEEKNUM(TODAY(),1)+3))

 

Thanks,

Nilesh Jain

View solution in original post

3 REPLIES 3
themistoklis
Community Champion
Community Champion

@jnnilesh29 

 

If you have a week number field (anging from 1-53) you can use the following formula:

Hours for next 3 weeks = 
CALCULATE(SUM('Resource Management'[Hours]),
    FILTER (
        ALL ( Calendar ),
        Calendar[WeekID]
            >= MAX ( Calendar[WeekID] ) 
            && Calendar[WeekID] <= MAX ( Calendar[WeekID] + 3 )
    )
)

Thanks for your reply @themistoklis 

jnnilesh29_0-1603228833132.png

I have created a separate WEEKNUM column in my sheet but I'm getting the above error.

The following is the link to the file. Please let me know if you cannot access it. 

 

https://www.dropbox.com/s/twnck91v5tbe65s/Resource%20Management%20-%20Power%20BI.pbix?dl=0 

 

I'm looking forward to hearing from you.

 

Thanks and Regards,

Nilesh

 

For someone who is looking for the solution for the sum of values between the current week to the next 3 weeks:

Hours for next 3 weeks = 
CALCULATE
(SUM('Resource Management'[Hours]),
FILTER(ALL('Resource Management'[WEEK NUMBER]),
'Resource Management'[WEEK NUMBER]>=WEEKNUM(TODAY(),1) && 'Resource Management'[WEEK NUMBER]<=WEEKNUM(TODAY(),1)+3))

 

Thanks,

Nilesh Jain

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors