cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Syndicate_Admin
Administrator
Administrator

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
Syndicate_Admin
Administrator
Administrator

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?

Hi @Syndicate_Admin 

 

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

amitchandak
Super User
Super User

@Syndicate_Admin ,

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))

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors