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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
CJANE
Helper I
Helper I

Prior Year To Date Frustration

All:

 

I have been battling the abiliy to display YTD and Prior YTD.  My dataset is very simple - example is below:

 

DateValue
4/5/20215
4/4/20215
4/3/20215
4/2/20215

 

My expressions are

YTD:  

YTD = TOTALYTD(SUM('Sheet1'[Value]), 'Sheet1'[Date])
Prior Year to Date:
LYTD = CALCULATE(Sheet1[YTD],(SAMEPERIODLASTYEAR(Sheet1[Date])))
 
If I add the date to my visual I am able to get the value I expect for each date.
 
CJANE_0-1617735075704.png

 

I cant figure out why the sum of Prior YTD has 605 and not 480.  If I remove the individual date from the visual my numbers are incorrect.

 

CJANE_1-1617735208093.png

 

Very Frustrated - any help would be appreciated.

1 REPLY 1
MattAllington
Community Champion
Community Champion

There are rules that you must follow to use these functions. The most important is that you need to use a calendar table. I cover this topic extensively here https://exceleratorbi.com.au/power-bi-calendar-tables/

 

Once you understand the calendar, I have an article here about how time intelligence works. https://exceleratorbi.com.au/power-bi-calendar-tables/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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.