cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

## Problem with SAMEPERIODLASTYEAR

Good morning

I have a chart in which I show all the printing expenses that my company has since January 2020.

I would like to calculate the total for the same period (January-June) but last year.

Using this formula still gives me error.

Total previous year period = CALCULATE(SUM('Printer Expenses'[Total(€)]),SAMEPERIODLASTYEAR(Calendar[Date]))
Can anyone help me?
Thank you!
3 REPLIES 3

I'm sorry but I don't calculate it well either, it gives me the total of the previous year but not as I want, from January to June.

Does anyone know how it works?

Community Support

What visuals do you put this measure in? Measures are calculated according to the context they are in, so we need to take care of the effect other columns in the same visual may have.

Regards,
Community Support Team _ Jing

Super User

This seems like fine

Total previous year period = CALCULATE(SUM('Printer Expenses'[Total(€)]),SAMEPERIODLASTYEAR(Calendar[Date]))

try like Total previous year period = CALCULATE(SUM('Printer Expenses'[Total(€)]),dateadd(Calendar[Date],-1,year))

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors