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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Pastrupgaard
Helper I
Helper I

problem with sameperiodlastyear

Hi guys

 

I've created YTD in the following period 01/01 --> 10/27 with the following formula, but I'm having trouble with incorporating the sameperiodlastyear formula in it:

 

Actual YTD ($) =  TOTALYTD (sum(f_sales[Actual ($)]) ; d_time[calender_date] ; DATESBETWEEN(d_time[calender_date] ; "01/01";"10/27"))

 

I've also postet a picture, since it's easier to see

qm.PNG


I appreciate any ideas of how to get the same periodlastyear

 

Thanks in advance

1 ACCEPTED SOLUTION

I got it to work with Calculate instead of TOTALYTD. Not sure what the difference is, but it works 🙂qm.PNG

 

Thanks for the help

 

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

Hi @Pastrupgaard

 

Try wrapping Datesbetween with sameperiodlastyear

 

SAMEPERIODLASTYEAR (DATESBETWEEN (_________))

Hi @Zubair_Muhammad

 

For some reason. it's not possible to have both the sameperiodlastyear and datesbetween in the same formula 😞

 

qm.PNG

 

Br
Pastrupgaard

@Pastrupgaard

 

Remove the last bracket please

 

I see a Red ")" in the image you posted

Hi @Zubair_Muhammad

 

My bad 🙂

 

I've corrected the formula, but there is no data output... I've recreated the data with a stupid workaround (so i know the data is there) and now i'm trying to make it smarter with this formula.

 

qm.PNG

 

Any smart ideas?

Br
Pastrupgaard

I got it to work with Calculate instead of TOTALYTD. Not sure what the difference is, but it works 🙂qm.PNG

 

Thanks for the help

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.