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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nidheshtiwari
Frequent Visitor

Calculate % Growth change on the basis of Selected Period

Hi All, 

I am struggling to find the soultion for the below problem statement. I have to create a measure to calculate the %change from selected quarter range. For example, we have data of 2023 from each month with salesDate. 

nidheshtiwari_0-1721809043405.png

 @Greg @HotChilli @bhanu @bhanu_gautam @lbendlin

@Irwan 

 

 

Many Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nidheshtiwari ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

Rank = RANKX(ALLSELECTED('Table'[Quarter-Year]),[Quarter-Year],MAX('Table'[Quarter-Year]),ASC)
% Change = var a=[Rank]-1
var b=CALCULATE(SUM('Table'[Sales  Amount]),FILTER(ALLSELECTED('Table'),[Rank]=a))  
var c=SUM('Table'[Sales  Amount])
RETURN  DIVIDE(c-b,b,0)

(3) Then the result is as follows.

vtangjiemsft_0-1722240794298.png

vtangjiemsft_1-1722240813915.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @nidheshtiwari ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

Rank = RANKX(ALLSELECTED('Table'[Quarter-Year]),[Quarter-Year],MAX('Table'[Quarter-Year]),ASC)
% Change = var a=[Rank]-1
var b=CALCULATE(SUM('Table'[Sales  Amount]),FILTER(ALLSELECTED('Table'),[Rank]=a))  
var c=SUM('Table'[Sales  Amount])
RETURN  DIVIDE(c-b,b,0)

(3) Then the result is as follows.

vtangjiemsft_0-1722240794298.png

vtangjiemsft_1-1722240813915.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

SachinNandanwar
Super User
Super User

Is this what you are looking for ?

Recording 2024-07-25 at 13.20.43.gif



Regards,
Sachin
Check out my Blog
sjoerdvn
Super User
Super User

You might want to share a bit more about your model, are you using a date dimension?
At any rate, you will need some column in a year-quarter format to be able to determine the previous selected quarter.

bhanu_gautam
Super User
Super User

@nidheshtiwari , First create a measure

 

Total Sales Amount =
SUM('Sales'[SalesAmount])

 

Than create one more measure for percentage change

% Change =
VAR SelectedQuarters = VALUES('Sales'[Quarter-Year])
VAR FirstQuarter = MINX(SelectedQuarters, [Quarter-Year])
VAR PreviousQuarterSales =
CALCULATE(
[Total Sales Amount],
FILTER(
ALL('Sales'),
'Sales'[Quarter-Year] = FirstQuarter
)
)
RETURN
IF(
ISBLANK(PreviousQuarterSales),
0,
DIVIDE(
[Total Sales Amount] - PreviousQuarterSales,
PreviousQuarterSales,
0
)
)

 

Add quarter year file




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi Bhanu,

Thanks for reply but it is not working. I am getting 0.0% for all the selected quarters.

% Change =
VAR SelectedQuarters = VALUES('Table'[Quarter-Year])
VAR CurrentQuarter = SELECTEDVALUE('Table'[Quarter-Year])
VAR PreviousQuarter =
CALCULATE(
MAX('Table'[Quarter-Year]),
FILTER(
ALL('Table'),
'Table'[Quarter-Year] < CurrentQuarter &&
'Table'[Quarter-Year] IN SelectedQuarters
)
)
VAR PreviousQuarterSales =
CALCULATE(
[Total SalesAmount],
'Table'[Quarter-Year] = PreviousQuarter
)
VAR CurrentQuarterSales = [Total SalesAmount]
VAR PercentageChange =
IF(
ISBLANK(PreviousQuarterSales),
BLANK(),
DIVIDE(CurrentQuarterSales - PreviousQuarterSales, PreviousQuarterSales, 0)
)
RETURN
IF(
ISBLANK(PreviousQuarter),
0,
PercentageChange
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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