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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Helper I
Helper I

Year to Date on hourly values

Dear Community,


I hope you can help me. I know how to get a running total and year-to-date based on daily values. However, it doesn't work for hourly values. Is there a "standard" way to get a year-to-date value for hourly values?


Looking forward to your feedback.


Best regards


Super User
Super User

@Manuel123 , if you need till now


YTD Now=
var _min = date(year(today()),1,1)
var _day = Now()
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Datetime] >=_min && 'Date'[Datetime] <= _day) )



If you need put hour too, then you need to have date and time table


YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) )
, filter(all(Time), time[Hour] <= max(time[Hour])))



column you need


in date Table

Day of Year =datediff([Year Start date] , [Date],Day) +1




In fact to separate date and time


Date = [datetime].date
Date = date(year([datetime]),month([datetime]),day([datetime]))


Time = [datetime].Time
Time = Time(hour([datetime]),minute([datetime]),second([datetime]))


Dear @amitchandak,


thank you very much. What do you mean by 'Date'[Year Rank]?


Best regards


Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.