cancel
Showing results for
Did you mean:
Frequent Visitor

## 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
Super User

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

Proud to be a Super User!

Super User

@tanner_lawlis , 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

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839

Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!
Frequent Visitor

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.

Announcements

#### The Power BI Community Show

Shabnam Watson demos Incremental refresh & Hybrid Tables and Leila Etaati demos Charticulator.