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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
luanamoreschi
Frequent Visitor

Growth - Same period last year

Hello Everyone!

I'm facing some difficulties in calculating the YoY Growth (sharing QTD sales vs the same period last year)


I'm using the formula below to calculate the QTD Orders from this year, and the result is coming right

QTD Sales = CALCULATE(COUNT('Orders'[Order Date]),DATESQTD(('Calendar'[ Date])))


The problem is in the formula that calculates the same period from last year:

Last Year QTD Orders = calculate(count(Orders'[Order Date]),DATESQTD(DATEADD('calendar'[ Date],-1,YEAR)))

It's bringing the result from the WHOLE quarter last year, not from the same period as this year (QTD)

I've tried to calculate using the SAMEPERIODLASTYEAR and I got the same results.

I don't know if the problem is in my calendar, which was built this way:

 

Calendar =
var mindate = year(MIN('Orders'[Order Date]))
var maxdate = YEAR(MAX('Orders'[Order Date]))
return

ADDCOLUMNS(
FILTER(
CALENDARAUTO(),
YEAR([Date]) >= mindate && YEAR([Date]) <= maxdate
),
"Year", YEAR([Date]),
"Month", FORMAT([Date],"mmmm"),
"Month_Number", MONTH([Date]),
"Quarter", FORMAT([Date], "\QQ"
)
)

 

I already marked the calendar as date table.

 

Thank you so much in advance

2 REPLIES 2
Mikelytics
Resident Rockstar
Resident Rockstar

Hi luanamoreschi,

 

Can you please try:

 

Last Year QTD Sales =
   CALCULATE(
      [QTD Sales],
      DATEADD('calendar'[ Date],-1,YEAR)
   )

 

PREVIEW
 
Best regards
Michael
 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 
 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
lukiz84
Memorable Member
Memorable Member

Did you try

 

 

Last Year QTD Sales =
   CALCULATE(
      [QTD Sales],
      SAMEPERIODLASTYEAR('Calendar'[Date])
   )

 

?

BR

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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