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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
eburg
Frequent Visitor

Comparing Against Prior Fiscal Period

Hello, 

 

I'm trying to calculate something rather simple. I want to compare my current Fiscal Period sales versus previous same Fiscal Period last year. So like Period 1 2021 versus Period 1 2020. I was trying to get SAMEPERIODLASTYEAR to work but I think it's struggling with the way by calendar table is set up. 

 

You can see the sales table and calendar table below. The Date field in both are linked in the data model. My measure to calculate current period sales all functions properly. I just can't figure out how to calculate prior year fiscal period. Thanks, 

 

 

Table 2.PNGTable 3.PNGTable1.PNG

3 REPLIES 3
Anonymous
Not applicable

Hi @eburg 

Has your problem been solved ? If no, please provide your sample and the result you want .

If it has been solved, provide your method for the problem then consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards

Community Support Team _ Ailsa Tao

eburg
Frequent Visitor

Okay I could try that. It's sort of a workaround for the problem but might work for now. Thanks, 

pfarahani
Helper II
Helper II

Try something like this:

 

For mine, I Added an additional date column to my table which subtracts the current date by one year:

PY Date = DATE(YEAR(Dates[Date])-1,MONTH(Dates[Date]),DAY(Dates[Date]))

Then used the following DAX to return the sales amount from the previous year:
 
Total Value Previous Year =
CALCULATE (
[Total Sales],
FILTER (
ALL ( Dates ),
Dates[Year] = MAX ( Dates[Year])-1
&& Dates[Date] <= MAX ( Dates[PY Date] )
))

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.