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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Trouble with Calculated Field for YoY

Hi all,

 

I am trying to create a calcualted field for YoY, but it is a little tricky...

 

The field I am trying to calculate YoY for is called "QTD Orders Revenue." I need to compare QTD Orders Revenue for "2022-Q3," the current quarter, to "2021-Q3," the same quarter but a year ago. Likewise, I want to calculate YoY for ANY previous quarters as well... I.e., "2022-Q2" vs "2021-Q2" or "2022-Q1" vs "2021-Q1" etc...

 

The biggest challenge is figuring out how to tell PowerBI that you need to subtract 1 from the year but keep the quarter the same.

 

Any help is appreciated 🙂 

 

Thank you!

 

Best,

Tanner

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

pls see the attachment to check if this is what you want





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , Sameperiod last year can help

 

example

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

 

or

 

Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))
Last year same full QTR Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))

 

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA


Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

Anonymous
Not applicable

Hi, I tried SAMEPERIODLASTYEAR as well as DATEADD, but these formulas don't work since my FY-FQ column (i.e., 2022-Q1) is not formatted as a date. 

 

My dataset only has fiscal years and fiscal quarters, not exact dates.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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