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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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