March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
Solved! Go to 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!!
Proud to be a 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) ?
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!!
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!!
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
17 | |
9 | |
5 |
User | Count |
---|---|
37 | |
29 | |
16 | |
14 | |
12 |