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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
London12
New Member

Percent change inquarter to quarter

I am trying to get a quarterly change in percentage but not sure why the chart is showing nothing, I have wracked my brain and couldn't figure issue, please help.  
 
London12_0-1692635929533.png

 

 
quarterly change  =
var last_date = CALCULATE(LASTDATE('Rental Data'[Date_].[Date]))
var DateLastQuarter = EOMONTH(DATE(YEAR(last_date),MONTH(last_date)-3,DAY(last_date)-1),0)
var calculateLast_date = calculate (average('Rental Data'[Rent ]),'Dates'[Date_]=last_date)
var calculateDateLastQuarter = calculate (average( 'Rental Data'[Rent ]), 'Dates'[Date_]=DateLastQuarter)
var change = (calculateLast_date-calculateDateLastQuarter)/ calculateDateLastQuarter
return change
 
 
London12_1-1692636006805.png

 

 
2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @London12 ,

quarterly change =
VAR CurrentQuarterStart = STARTOFQUARTER(MAX('Dates'[Date_]))
VAR PreviousQuarterStart = DATEADD(CurrentQuarterStart, -1, QUARTER)
VAR CurrentQuarterEnd = ENDOFQUARTER(MAX('Dates'[Date_]))
VAR PreviousQuarterEnd = ENDOFQUARTER(PreviousQuarterStart)

VAR CurrentQuarterAverage = CALCULATE(
    AVERAGE('Rental Data'[Rent]),
    DATESBETWEEN('Dates'[Date_], CurrentQuarterStart, CurrentQuarterEnd)
)
VAR PreviousQuarterAverage = CALCULATE(
    AVERAGE('Rental Data'[Rent]),
    DATESBETWEEN('Dates'[Date_], PreviousQuarterStart, PreviousQuarterEnd)
)

VAR Change = (CurrentQuarterAverage - PreviousQuarterAverage) / PreviousQuarterAverage
RETURN Change

This measure calculates the start and end dates for the current and previous quarters, and then calculates the average rent for each quarter. Finally, it calculates the percentage change between the two averages.

Please try using this updated measure in your line chart and see if it resolves the issue.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Anonymous
Not applicable

I don't know if I got your dataset right in doing the following as the screenshot was a very small subset of what seems as a much larger set of data.  But this might help and lead you in the direction you are attempting.  It is the CALCULATE and filter that should help you in your direction (or answer):
Options (suggestion):
Quarterly Change % = VAR CurrentQuarter = MAX ( Table[Year Quarter] ) VAR PreviousQuarter = CALCULATE ( MAX ( Table[Year Quarter] ), PREVIOUSQUARTER ( Table[Date2] ) ) VAR CurrentRent = CALCULATE ( SUM ( Table[Rent] ), Table[Year Quarter] = CurrentQuarter ) VAR PreviousRent = CALCULATE ( SUM ( Table[Rent] ), Table[Year Quarter] = PreviousQuarter ) RETURN IF ( PreviousRent > 0, DIVIDE ( CurrentRent - PreviousRent, PreviousRent ) ); or another option:
---------------------
QuarterlyChangePercentage =
VAR PreviousQuarterRent =
CALCULATE(
SUM('Table'[Rent]),
FILTER(
ALL('Table'),
'Table'[Year Quarter] = EARLIER('Table'[Year Quarter]) - 1
)
)
VAR CurrentQuarterRent =
SUM('Table'[Rent])
RETURN
IF(
ISBLANK(PreviousQuarterRent),
BLANK(),
DIVIDE(
CurrentQuarterRent - PreviousQuarterRent,
PreviousQuarterRent
)
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.