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

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

Reply

Calculate % from previous Quarters with ability to use filter

Hi all,

Hope somebody can help me.

I have simple table (viz print screen) contains Quarters, Number, % from previous period.

lucie_rabochova_0-1698228966040.png

BUT I want to use Quarter filter and compare for example 2021-Q1 and 2022-Q1, this is problem, because it doesnt work anymore, viz printscreen.

lucie_rabochova_1-1698229127280.png

As you can see, it is still calculating previous period and it is not able to be dynamic. 

This is my formula:

 

QoQ (%) =
VAR V = CALCULATE([Views],PREVIOUSQUARTER(DimDates[Date]))
RETURN
    DIVIDE([Views]-V,V)
 
How can I change the above formula to cooperate with filter and be dynamic?
Thanks a lot for your help
1 ACCEPTED SOLUTION

3 REPLIES 3
Walter_W2022
Resolver II
Resolver II

Hi @lucie_rabochova ,

Please use OFFSET and ALLSELECTED in dax to calculate previous row value, please see below and attched PBI file

_Prev_Quarter =
CALCULATE(
    [_Sales_Amount],
    OFFSET(
        -1,
        ALLSELECTED('Table'[YearQuarter]),
        ORDERBY('Table'[YearQuarter],ASC),
        DEFAULT
    )
)

wangbt89_0-1698242807616.png

 

20231026-example.pbix
Here is the exaple file.

Thank you so much! This is amazing solution and it works perfect.

All the best, Lucie

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.