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
georgec96
Helper II
Helper II

Year on Year growth DAX measure

Hi guys sorry in advance if this is a silly questions I am still trying to get the grasp of DAX

I have the following dataset

StoreOrdered itemsPrice per itemDate ordered
AA89 £                    9.0001/01/2022
AA52 £                    9.0001/02/2022
AA66 £                    9.0003/03/2022
AA100 £                    9.0002/02/2022
BB6020 £                    9.0002/02/2022
BB2525 £                    9.0002/02/2022
BB1059 £                    9.0002/02/2022
BB10002 £                    9.0001/06/2019
CC512 £                    9.0001/05/2023
CC9999 £                    9.0001/01/2020
CC25 £                    9.0001/01/2001

 

I am trying to calculate year on year growth however I am not sure what I am doing wrong as I cant get it to work.

 

I have also created a calendar table and there is a relationship between them.

 

I am using the following formula and can't figure out what is wrong with it.

 

YearonYear= DIVIDE( SUMX('Aggregated data', 'Aggregated data'[Price per item] * 'Aggregated data'[Ordered qty]), CALCULATE( SUMX('Aggregated data', 'Aggregated data'[Price per item] * 'Aggregated data'[Ordered qty]), SAMEPERIODLASTYEAR('CALENDAR'[Date]) ) )

Any help would be much appreciated

1 REPLY 1
johnt75
Super User
Super User

Try

YearonYear =
VAR LastYear =
    CALCULATE (
        SUMX (
            'Aggregated data',
            'Aggregated data'[Price per item] * 'Aggregated data'[Ordered qty]
        ),
        SAMEPERIODLASTYEAR ( 'CALENDAR'[Date] )
    )
VAR ThisYear =
    SUMX (
        'Aggregated data',
        'Aggregated data'[Price per item] * 'Aggregated data'[Ordered qty]
    )
VAR Result =
    DIVIDE ( ThisYear - LastYear, LastYear )
RETURN
    Result

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.