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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sdutta
Regular Visitor

Calculate YTD sum total of value

Hi All, I have gone through the existing questions and solutions around the same requirement but struggling a bit, which probably might be down to the fact that my date column is in a different format.

 

If I am trying to sum a value based on a period_code column which holds values like 201601, 201602, 201603....201612 (that corresponds to Oct-2016, Nov-2016, Dec-2016....Sep-2016 as Oct is our financial year beginning), will the logic work? Or do I need to convert the period_code column to actual dates?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Not to worry, I figured it out at the T-SQL level.

View solution in original post

2 REPLIES 2
Sdutta
Regular Visitor

Hi All,

I have now included a column called Period_EndDate that corresponds to the end date against each Period_Name.

 

Period_Name                         col2
Dec-2016                           2016-12-31
Nov-2016                          2016-11-30
Oct-2016                           2016-10-31

 

This formula doesnt seem to be working correctly though when trying to calculate YTD sum of actual values

 

YTD_Actuals = CALCULATE(SUM(KPI[Actual]),DATESYTD(KPI[Period_EndDate].[Date]))

 

Please help.

 

Not to worry, I figured it out at the T-SQL level.

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.

Top Solution Authors