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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
BhavyaM
Helper V
Helper V

How to calculate QOQ change % on year

I have sales column with date column (2019Q1,2019Q2,2019Q3,2019Q4,2020 Q1)

 

Here In Table chart I need to show QoQ change percentage on Year basis like for ex: 

2019Q1 % will be (2020Q1/ 2019Q1)-1

2019Q2 % will be (2020Q1/2019q2)-1

2019Q3 % will be (2020q1/20219q3)-1

 

Please help me how to achieve this

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @BhavyaM ,

 

I create a simple sample. Please reference it to have a try.

 

Calendar =
ADDCOLUMNS (
    CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
    "Year", YEAR ( [Date] ),
    "Qtr", QUARTER ( [Date] )
)

 

% = 
VAR MaxYear =
    MAX ( 'Calendar'[Year] )
VAR MaxQtr =
    CALCULATE (
        MAX ( 'Table'[Qtr] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = MaxYear )
    )
VAR ThisQtr =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Qtr] = MaxQtr && 'Table'[Year] = MaxYear )
    )
VAR LastQtr =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( 'Table', 'Table'[Year] = MaxYear - 1 )
    )   
RETURN
    DIVIDE ( ThisQtr - LastQtr, LastQtr )

1.PNG

 

For more details, please see the attachment.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @BhavyaM ,

 

I create a simple sample. Please reference it to have a try.

 

Calendar =
ADDCOLUMNS (
    CALENDAR ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ) ),
    "Year", YEAR ( [Date] ),
    "Qtr", QUARTER ( [Date] )
)

 

% = 
VAR MaxYear =
    MAX ( 'Calendar'[Year] )
VAR MaxQtr =
    CALCULATE (
        MAX ( 'Table'[Qtr] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = MaxYear )
    )
VAR ThisQtr =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Qtr] = MaxQtr && 'Table'[Year] = MaxYear )
    )
VAR LastQtr =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( 'Table', 'Table'[Year] = MaxYear - 1 )
    )   
RETURN
    DIVIDE ( ThisQtr - LastQtr, LastQtr )

1.PNG

 

For more details, please see the attachment.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahoneypat
Microsoft Employee
Microsoft Employee

Do you have a Date table in your model?  If so, you can make a column that has the same YearQuarter syntax and have a relationship to your existing YearQuarter column, and you could use Time Intelligence DAX to do you calculatation.  If not, you could add a column in the query editor (or with DAX as a calculated column) that has the last date of each quarter.  Then you can write DAX expressions with variables to get the current value and previous quarter value, and do you calculation to get the QoQ change.


If you are not familiar with how to do that, you can post some sample/mock data and the community will likely respond with the exact formula you need.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors