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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
kari1282
Helper III
Helper III

Previous year error

I'm trying to calculate the total hours but from the date November 1, Previous Year to Today. 

 

AA YTD Billable Hours = CALCULATE(SUM(SQL[Billable]), DATESBETWEEN(SQL[workacctperiod].[Date], DATE(TODAY()-1, 11,1), Today()))
 
However, I am recieving an error
 
 
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

plse try this

AA YTD Billable Hours = 
VAR _ToDay = Today()
RETURN
CALCULATE(SUM(SQL[Billable]), 
     DATESBETWEEN(SQL[workacctperiod].[Date], DATE(YEAR(_ToDay)-1, 11,1), 
           _ToDay))

View solution in original post

1 REPLY 1
Ahmedx
Super User
Super User

plse try this

AA YTD Billable Hours = 
VAR _ToDay = Today()
RETURN
CALCULATE(SUM(SQL[Billable]), 
     DATESBETWEEN(SQL[workacctperiod].[Date], DATE(YEAR(_ToDay)-1, 11,1), 
           _ToDay))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.