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

YOY and by QTR Growth %

Hello

I wanted to create a calculated field that can show both the breakdown of the year-to-year growth percentage and the qtr growth rate. The following is a sample panel for reference.

Link

Data:

ReservationsQtrYear
1000Q4FY182018
2000Q3FY192019
10000Q1FY202020
25000Q3FY182018
6000Q2FY192019
50000Q2FY202020

Thank you in advance to anyone who can help!!.

10 REPLIES 10
amitchandak
Super User
Super User

 

In case you are using Date then use time intelligence

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD((Table[Date])))

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd(Table[Date],-1,QUARTER)))
CALCULATE([Total Value], PREVIOUSQUARTER('Calendar'[Date]))
Last complete QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd(Table[Date],-1,QUARTER))))

Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd(Table[Date],-2,QUARTER)))
Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd(Table[Date],1,QUARTER)))

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

trailing QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd(Table[Date],-1,QUARTER))
trailing  4 QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd(Table[Date],-4,QUARTER))



YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((Table[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR(Table[Date])),"12/31"))

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd(Table[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd(Table[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd(Table[Date],-2,Year),"12/31"))

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

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

In case you do not have Date use Rank .

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

This Qtr= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[QtrRank]=max('Date'[QtrRank])))
Last Qtr= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[QtrRank]=max('Date'[QtrRank])-1))

Last Qtr last year= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[QtrRank]=max('Date'[QtrRank])-4))

 

Refer to my Webinar:https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...

Anonymous
Not applicable

Appreciate for your recommendation and  suggesting me on intelligence function👍

Ashish_Mathur
Super User
Super User

Hi,

There must be a Month column in your source data.  That column can be the first or the last month of the quarter.  Also, please clarify the months which fall in Q1.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

Thanks for the response.

In my scenario, I don't have the exact dates for the bookings but Fiscal Q1 starts in August and ends in July for each fiscal year. 

I have added staring month for each Qtr below:

BookingsMonthQTRYear
1000MAYQ4FY182018
2000FEBQ3FY192019
10000AUGQ1FY202020
25000FEBQ3FY182018
6000NOVQ2FY192019
50000NOVQ2FY202020

Hi,

This is what i think you want.  Download the PBI file from here.

Hope this helps.

QoQ and YoY growth.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

hi @Anonymous 

For custom YOY, you could create a measure as below:

YOY_Last Year = CALCULATE([NET],FILTER(ALL(RETURNS[Year]),RETURNS[Year]=MAX(RETURNS[Year])-1))

 

If not your case, Please share your expected output for your sample data.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks for the Response. Actually I want to break down the growth by year and Qtr. Here's link PBI

hi  @Anonymous 

One question: In this sample, what is your expected output for [YOY_Last Year]

 

5.JPG

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nandukrishnavs
Super User
Super User

@Private

Because this is a time-smart calculation, you need a date column in the table.

Sample table

datereserves
What's 01 January 20181230
What's 01 February 20181200
March 1 20181170
April 1 20181140
May 01 20181110
What's 01 June 20181080
What's 01 July 20181050
What's 01 August 20181020
What's 01 September 20181110
What's 01 October 20181200
What's 01 November 20181290
What's 01 December 20181380
01 January 20191470
01 February 20191560
March 01 20191650
April 01 20191740
May 01 20191050
June 01 20191020
01 July 2019990
August 01 2019960
01 September 2019930
01 October 2019900
01 November 2019870
December 01 2019840
01 January 2020810
01 February 20201380
01 March 20201470
April 01, 20201560

QOQ% = 
VAR thisQTR =
    SUM ( 'Table'[Reservations])
VAR lastQTR =
    CALCULATE (
        SUM ('Table'[Reservations] ),
        DATESINPERIOD ( 'Table'[Date].[ Date], MIN ( 'Table'[Date] ), -1, QUARTER )
    )
RETURN
    DIVIDE ( thisQTR - lastQTR, lastQTR, 0 )

YOY% = 
VAR thisYear =
    SUM ( 'Table'[Reservations] )
VAR lastYear =
    CALCULATE ( SUM ( 'Table'[Reservations] ), SAMEPERIODLASTYEAR ( 'Table'[Date].[ Date] ) )
RETURN
    DIVIDE ( thisYear - lastYear, lastYear, 0 )


exit

myout.JPG
Did I answer your question? Mark my position as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

Appreciate for your suggestions 👍

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.