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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
IgorKaradzic
Helper I
Helper I

DAX formula for calculating % growth of profits over period of 5 years

Hi guys, i need help with DAX calculating % growth of profits over period of, let's say, 5 years. As you will see in table below i also have different work sectors(currently 1 in table) and i want to show in table visual top 3 work sectors with fastest growing profits over a period of 5 years.


Work SectorYearYearly net profit(€)
Acommodation and food services2019€ 294
Acommodation and food services2020€ 315
Acommodation and food services2021€ 339
Acommodation and food services2022€ 392
Acommodation and food services2023€ 440
Acommodation and food services2024€ 503
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @IgorKaradzic ,

 

Create a separate year column as a slicer. Then create the following formula:

result =
VAR sel_ =
    SELECTEDVALUE ( 'Date'[Year] )
VAR maxProfit =
    CALCULATE ( MAX ( 'Table'[Yearly net profit(€)] ), 'Table'[Year] = sel_ + 5 )
VAR minProfit =
    CALCULATE ( MAX ( 'Table'[Yearly net profit(€)] ), 'Table'[Year] = sel_ )
VAR per_ =
    DIVIDE ( maxProfit - minProfit, minProfit )
RETURN
    per_
1 =
IF ( RANKX ( ALL ( 'Table'[Work Sector] ), [result],, DESC ) <= 3, 1, 0 )

vkongfanfmsft_0-1716345435879.png

 

Best Regards,
Adamk Kong

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @IgorKaradzic ,

 

Create a separate year column as a slicer. Then create the following formula:

result =
VAR sel_ =
    SELECTEDVALUE ( 'Date'[Year] )
VAR maxProfit =
    CALCULATE ( MAX ( 'Table'[Yearly net profit(€)] ), 'Table'[Year] = sel_ + 5 )
VAR minProfit =
    CALCULATE ( MAX ( 'Table'[Yearly net profit(€)] ), 'Table'[Year] = sel_ )
VAR per_ =
    DIVIDE ( maxProfit - minProfit, minProfit )
RETURN
    per_
1 =
IF ( RANKX ( ALL ( 'Table'[Work Sector] ), [result],, DESC ) <= 3, 1, 0 )

vkongfanfmsft_0-1716345435879.png

 

Best Regards,
Adamk Kong

 

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

Thank you, it worked.

lbendlin
Super User
Super User

Please try to use a Quick Measure first. It has Year Over Year examples.  

 

Remember to add a calendar table to the data model.

 

Tried it and it also worked.Thank you for suggesting it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.