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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors