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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ConnorH
Microsoft Employee
Microsoft Employee

Help with YoY % change

Hi,

 

I have a table below. I am trying to take the [gross running YTD] column and find the percentage growth to the next value.

So for example the value 994143 wont have a percentage growth because there was no previous value but the 3589095 will show the % groth from the 994143 to the 3589095 and the next value will show growth from 3589095 to the 6379539.

 

YoY change.PNG

1 ACCEPTED SOLUTION
ConnorH
Microsoft Employee
Microsoft Employee

Just got this problem figured out so I am sharing the solution in case someone comes accross this thread with a similar problem.

Var prevValue = CALCULATE(MAX('Table'[Gross Revenue YTD]), FILTER('Table', 'Table'[Gross Revenue YTD] < EARLIER('Table'[Gross Revenue YTD])))
Var currentValue = 'Table'[Gross Revenue YTD]
var difference = currentValue-prevValue
return DIVIDE(difference,prevValue)

View solution in original post

3 REPLIES 3
ConnorH
Microsoft Employee
Microsoft Employee

Just got this problem figured out so I am sharing the solution in case someone comes accross this thread with a similar problem.

Var prevValue = CALCULATE(MAX('Table'[Gross Revenue YTD]), FILTER('Table', 'Table'[Gross Revenue YTD] < EARLIER('Table'[Gross Revenue YTD])))
Var currentValue = 'Table'[Gross Revenue YTD]
var difference = currentValue-prevValue
return DIVIDE(difference,prevValue)
amitchandak
Super User
Super User

@ConnorH , New columns

 

QTR Year = [Year]*100 + [quarter]
Qtr Rank = RANKX(all('Date'),'Date'[QTR Year],,ASC,Dense)

Last Value =
var _max = maxx(filter(Table, [Qtr Rank] <= earlier([Qtr Rank]) && not(isblank([Gross Running ytd]))),[Qtr Rank])
var _last = usmx(filter(Table, [Qtr Rank] =_max),[Gross Running ytd])
return
divide([Gross Running ytd] -_max, _max)

 

if you need measures , then make sure Qtr and Year and Qtr Year and Rank are in a separate table, say Date


This Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])))
Last Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-4)) // here there is diff of 4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have just done the following steps and am not receiving the correct values.

Here is a table to help clarify what I am struggling to do:

example.PNGCapture.PNG

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.