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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.