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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi experts!
Can you please take a look at my issue about calculating quarter over quarter changes below and advise how to fix it?
I have a item table that contains a list of items and their values and periord. The period column is in text format since it's a combination of year and quarter, like 2021 Q1. I also have a look up table that has 2 columns: the first column is same as the period column in the item table, and the 2nd column shows the previous quarter. For example, if the column 1 row 1 has 2021 Q2; the column 2 row 1 will be 2021 Q1. The tables are linked by Period.
I want to create a time series to show the quarter-over-quarter item value changes.
If the value for a item in 2021 Q2 is 100,000, and the value for the same item in 2021 Q2 is 150,000, then the change will be 50,000 (Q2 value - Q1 value). I want to do the same for all the 200 items in 5 years.
I create a measure called Previous Values to show the values for the previous quarters. Then I want to generate a table visual to show the period column, current quarter value, and the previous quarter value
here is my DAX: Previous Values = CALCULATE([Total values], PREVIOUSQUARTER(Item([Previous quarter])
But it doesn't work. It doesn't show the previous quarter value in the table. Any ideas? Thanks so much!
Solved! Go to Solution.
Hi @Lili304 ,
Here I create a sample to show you how to achieve your goal.
My Sample:
Data Model:
Measure:
Previous =
VAR _PREVIOUS_QUARTER =
CALCULATE (
MAX ( DimPeriod[Period] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Item] ),
'Table'[Period] < MAX ( DimPeriod[Period] )
)
)
VAR _RESULT =
CALCULATE (
SUM ( 'Table'[Values] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Item] ),
'Table'[Period] = _PREVIOUS_QUARTER
)
)
VAR _MAXPERIOD =
MAX ( 'Table'[Period] )
RETURN
IF ( SELECTEDVALUE ( DimPeriod[Period] ) > _MAXPERIOD, BLANK (), _RESULT )Diff = SUM('Table'[Values]) - [Previous]
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Lili304 ,
Here I create a sample to show you how to achieve your goal.
My Sample:
Data Model:
Measure:
Previous =
VAR _PREVIOUS_QUARTER =
CALCULATE (
MAX ( DimPeriod[Period] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Item] ),
'Table'[Period] < MAX ( DimPeriod[Period] )
)
)
VAR _RESULT =
CALCULATE (
SUM ( 'Table'[Values] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Item] ),
'Table'[Period] = _PREVIOUS_QUARTER
)
)
VAR _MAXPERIOD =
MAX ( 'Table'[Period] )
RETURN
IF ( SELECTEDVALUE ( DimPeriod[Period] ) > _MAXPERIOD, BLANK (), _RESULT )Diff = SUM('Table'[Values]) - [Previous]
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Rico!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |