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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
iceteapilot
Helper I
Helper I

Quick help Needed with calculating Growth Rate

Hi,

 

I am putting together a dashboard, need quick help on something.

I have sales data for various cars from 2008 to 2017. Now i want to calculate the growth of sales from year on year.

I have calculated 10 measures for each of the years from 2008 till 2017.

 

What is the best way to do this?Untitled.png

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @iceteapilot ,

 

If you want to calculate YOY growth rate based on segment, please refer to the following measure:

 

 

YoYGrowth =

VAR l =

    CALCULATE (

        SUM ( 'TABLE'[SALES] ),

        FILTER (

            ALL ( 'Table' ),

            'Table'[SEGMENT] IN DISTINCT ( 'Table'[segment] )

                && 'Table'[YEAR]

                    = MAX ( 'Table'[YEAR] ) - 1

        )

    )

VAR C =

    CALCULATE (

        SUM ( 'TABLE'[SALES] ),

        FILTER (

            ALL ( 'Table' ),

            'Table'[SEGMENT] IN DISTINCT ( 'Table'[segment] )

                && 'Table'[YEAR] = MAX ( 'Table'[YEAR] )

        )

    )

RETURN

    DIVIDE ( C, l ) - 1

 

 

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @iceteapilot ,

 

If you want to calculate YOY growth rate based on segment, please refer to the following measure:

 

 

YoYGrowth =

VAR l =

    CALCULATE (

        SUM ( 'TABLE'[SALES] ),

        FILTER (

            ALL ( 'Table' ),

            'Table'[SEGMENT] IN DISTINCT ( 'Table'[segment] )

                && 'Table'[YEAR]

                    = MAX ( 'Table'[YEAR] ) - 1

        )

    )

VAR C =

    CALCULATE (

        SUM ( 'TABLE'[SALES] ),

        FILTER (

            ALL ( 'Table' ),

            'Table'[SEGMENT] IN DISTINCT ( 'Table'[segment] )

                && 'Table'[YEAR] = MAX ( 'Table'[YEAR] )

        )

    )

RETURN

    DIVIDE ( C, l ) - 1

 

 

 

Best Regards,

Dedmon Dai

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@iceteapilot 


Take Year as a new Dimension and join with this table and the try

last year sales
calculate(sum(sales), filter(all(Year),Year[Year]=max(Year[Year])-1))
This year =
calculate(sum(sales), filter(all(Year),Year[Year]=max(Year[Year])))

Diff = [This year] -[last year sales]

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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