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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jos13
Helper III
Helper III

Week over Week Sales Growth

Hi Team,

I have a data set in the following format.

customersales.png

 

I have created a measure to calculate daily growth as follows

Daily growth% =
    VAR __PREV_day = CALCULATE([Sales], DATEADD('DateTable'[Date], -1, DAY))
    RETURN
        DIVIDE([Sales] - __PREV_day, __PREV_day)
 
I am not able to find weekly growth using the above method since week is not supported in DATEADD. Please help me on this.
 
Best Regards,
Jos
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Jos13,

You can try to use following link if it meets your requirement:

Weekly growth% =
VAR currDate =
    MAX ( 'DateTable'[Date] )
VAR _curr =
    CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALLSELECTED ( Table ),
            YEAR ( [Date] ) = YEAR ( currDate )
                && WEEKNUM ( [Date] ) = WEEKNUM ( currDate )
        )
    )
VAR _prev =
    CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALLSELECTED ( Table ),
            IF (
                WEEKNUM ( currDate ) > 1,
                YEAR ( [Date] ) = YEAR ( currDate )
                    && WEEKNUM ( [Date] ) = WEEKNUM ( currDate ),
                YEAR ( [Date] )
                    = YEAR ( currDate ) - 1
                    && WEEKNUM ( [Date] )
                        = WEEKNUM ( DATE ( YEAR ( currDate ) - 1, 12, 31 ) )
            )
        )
    )
RETURN
    DIVIDE ( _curr - _prev, _prev )

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @Jos13,

You can try to use following link if it meets your requirement:

Weekly growth% =
VAR currDate =
    MAX ( 'DateTable'[Date] )
VAR _curr =
    CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALLSELECTED ( Table ),
            YEAR ( [Date] ) = YEAR ( currDate )
                && WEEKNUM ( [Date] ) = WEEKNUM ( currDate )
        )
    )
VAR _prev =
    CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALLSELECTED ( Table ),
            IF (
                WEEKNUM ( currDate ) > 1,
                YEAR ( [Date] ) = YEAR ( currDate )
                    && WEEKNUM ( [Date] ) = WEEKNUM ( currDate ),
                YEAR ( [Date] )
                    = YEAR ( currDate ) - 1
                    && WEEKNUM ( [Date] )
                        = WEEKNUM ( DATE ( YEAR ( currDate ) - 1, 12, 31 ) )
            )
        )
    )
RETURN
    DIVIDE ( _curr - _prev, _prev )

Regards,

Xiaoxin Sheng

AntrikshSharma
Super User
Super User

Use the date template from SQLBI https://www.sqlbi.com/tools/dax-date-template/ it has week columns and then you can use FILTER ALL construct to do calculations over weeks.
amitchandak
Super User
Super User

@Jos13 , Try if this can help

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

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
Mariusz
Community Champion
Community Champion

Hi @Jos13 

 

You can use the Relative Date Dimension table or parts of it, the below blog post will have an example of the previous week

https://community.powerbi.com/t5/Community-Blog/Relative-Date-Dimension/ba-p/779039

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.