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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
binayjethwa
Helper IV
Helper IV

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.