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
Himanshu_1306
Resolver I
Resolver I

Dynamic QoQ%

Hi All,

 

I have created the below 2 measures to calculate the QoQ% for my data.

 

For Quarter values we follow the month end approach, i.e

 

Q1 -> Feb-April

Q2 -> May - Jul

Q3 -> Aug - Oct

Q4 -> Nov- Jan

 

As of now I have hard coded the last Quarter values in my calculation for QoQ%. Is there a way I can make it dynamic? We're comparing this quarter data Vs Same day last quarter data for QoQ% example Since today is 29th Dec so I'll be comparing data of today 29th Dec with data of last quarter same day i.e from 29th Sep - 31st October 

 

QTD ACV = CALCULATE([ACV],DATESBETWEEN(ACV[CLOSE_DATE],"11-01-2022",TODAY()))
 
QOQ% =
VAR thisQ =
    [QTD ACV]
VAR lastQ =
    CALCULATE (
        [ACV],
        DATESBETWEEN(ACV[CLOSE_DATE],"09-29-2022","10-31-2022")
    )
RETURN
    DIVIDE ( thisQ - lastQ, lastQ, 0 )
2 REPLIES 2
amitchandak
Super User
Super User

@Himanshu_1306 , First you have two create Qtr Rank and Day of Qtr

 

new column , in Date Table

Qtr Start Date = var _rem = mod(month([Date]),3)
return eomonth([Date], Switch(_rem,2,-1, 0,-2, 1,-3))+1

 

Qtr Rank = RANKX(all('Date'),'Date'[Qtr Start date],,ASC,Dense)

 

Qtr Day = DATEDIFF('Date'[Qtr Start Date],'Date'[Date],Day)+1

 

Measures

 

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

 

This QTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank]) && [Qtr Day] <=max([Qtr Day])))
Last QTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-1 && [Qtr Day] <=max([Qtr Day])))

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

@amitchandak Thanks for the quick update.

 

I'll check the details and will update soon.

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.