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

How to get Fiscal Quarter Over Qtr change

Hi Guys,

 

Can you please help me how i can get Fiscal Quarter over Quarter change %. I have data like below
2016-Q1 --> 100
2016-Q2 --> 200
2016-Q3 --> 300

2016-Q4--> 400

2017-Q1 --> 150
2017-Q2 --> 250
2017-Q3 --> 350

2017-Q4--> 450

I need to calculate 2016Q1 with 2017-Q1 and so on.. 
Also As i mentioned this are fiscal qtr so start date and end date wont be same Q1 start from April and Q4 qtr ends in mar.  



Let me know how to acheive this. 

 

Thanks in advance.

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous Not quite clear if you have actual dates or just those year-quarter things. If just the year-quarter things, you could do:

Measure = 
  VAR __Value = MAX('Table'[Value])
  VAR __Current = MAX('Table'[YearQuarter])
  VAR __CurrentYear = LEFT(__Current,4) * 1.
  VAR __CurrentQuarter = RIGHT(__Current,2)
  VAR __PreviousYear = IF(__CurrentQuarter="Q1",__CurrentYear - 1,__CurrentYear)
  VAR __PreviousQuarter = 
    SWITCH(__CurrentQuarter,
      "Q1","Q4",
      "Q2","Q1",
      "Q3","Q2",
      "Q3"
    )
  VAR __PreviousYearQuarter = __PreviousYear & "-" & __PreviousQuarter
  VAR __PreviousValue = MAXX(FILTER('Table',[YearQuarter]=__PreviousYearQuarter),[Value])
RETURN
  (__CurrentValue - __PreviousValue)/__PreviousValue

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , I ncase you have date table you can use datesqtd.

Else create a qtr table and create Rank

 

Qtr Rank = RANKX(all('Date'),'Date'[Qtr],,ASC,Dense)  // YYYY QQ should fit here but have a separate table
This Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])))
Last Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-1))

 

if you have date then

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

 

Power BI — QTD
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839

 

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.