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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
binayjethwa
Helper V
Helper V

How to calculate ROY(Rest of Year) Hours in dax

Hi , 

 

I have the following requirement where i need to calculate ROY(Rest of Year Hours)

 

I have a week start date column and my calendar starts on First monday of July and ends in June. 

 

Based on this condition i need to calculate rest of year hours for the hours column. 

 

I am using below measure but its returning blank. basically what ever dates are finished i need not calculate the sum of those hours only the rest of Year.

 

CALCULATE(
    SUM('Retain Dump'[Retain Hours]),
    FILTER(
        ALL('Retain Dump'),
        'Retain Dump'[Date] > TODAY() &&
        'Retain Dump'[Date] <= DATE(YEAR(TODAY()), 6, 30)
    )
)
 
Is there any other method we can achieve this. Please help.
1 ACCEPTED SOLUTION

Hi @binayjethwa - Oh Ok, if you are using wstart date, please use the updated one below, check it.

 

ROY Hours =
VAR CurrentDate = TODAY()
VAR CurrentYear = YEAR(CurrentDate)
VAR EndOfYearDate =
IF(
CurrentDate > DATE(CurrentYear, 6, 30),
DATE(CurrentYear + 1, 6, 30),
DATE(CurrentYear, 6, 30)
)
RETURN
CALCULATE(
SUM('Retain Dump'[Retain Hours]),
FILTER(
'Retain Dump',
'Retain Dump'[Week Start Date] > CurrentDate &&
'Retain Dump'[Week Start Date] <= EndOfYearDate
)
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
miTutorials
Super User
Super User

There seems to be a problem in your logic, please see the dates it is returning. I guess you are trying to sum Hours until the end of Next year (Jun 2025) ? 

 

miTutorials_0-1720103703888.png

 

rajendraongole1
Super User
Super User

Hi @binayjethwa -Can you try the below measure

ROY Hours =
VAR CurrentDate = TODAY()
VAR EndOfYearDate = DATE(YEAR(CurrentDate), 6, 30)
RETURN
CALCULATE(
SUM('Retain Dump'[Retain Hours]),
FILTER(
'Retain Dump',
'Retain Dump'[Date] > CurrentDate &&
'Retain Dump'[Date] <= EndOfYearDate
)
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1  , i am seeing the output as Blank , my date field is basically a week start date.

Hi @binayjethwa - Oh Ok, if you are using wstart date, please use the updated one below, check it.

 

ROY Hours =
VAR CurrentDate = TODAY()
VAR CurrentYear = YEAR(CurrentDate)
VAR EndOfYearDate =
IF(
CurrentDate > DATE(CurrentYear, 6, 30),
DATE(CurrentYear + 1, 6, 30),
DATE(CurrentYear, 6, 30)
)
RETURN
CALCULATE(
SUM('Retain Dump'[Retain Hours]),
FILTER(
'Retain Dump',
'Retain Dump'[Week Start Date] > CurrentDate &&
'Retain Dump'[Week Start Date] <= EndOfYearDate
)
)

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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