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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Weekly time % changes and trends

Hi there, 

 

I have a table with count of new users by day. The date column is connected to a calendar table, where I've included a 'week' and 'week commencing' column. I've set the week commencing to be Sunday

 

Is someone about to help me with some DAX for: 

Current week: Sum of users in current week (whenever report is refreshed) 

Last full week: sum of users in last full week (Sun - Sat) 

% change against week prior 

% change against same week last year

% change against weekly average over last 12 months

 

Thank you so much in advance!

Sonia

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

weeknum =
CALCULATE (
    SUM ( 'Table 2'[value ),
    FILTER (
        ALL ( 'Table 2' ),
        YEAR ( 'Table 2'[Date] ) = YEAR ( TODAY () )
            && 'Table 2'[Week] = WEEKNUM ( TODAY (), 1 )
    )
)

Similar to the ringgit, the growth over the same period can be referred to the following formula:

last week = CALCULATE([Amount_filter],DATEADD(M_DimDate[Date],-1,Week))

last week_amount =
VAR Pervious = [last week]
VAR diff =
    SUM ( FactInternetSales[SalesAmount] ) - Pervious
RETURN
    DIVIDE ( diff, Pervious, BLANK () )

vhenrykmstf_0-1659926792130.png

 

For more details, you can read below blog:

Calculate Percentage Growth Over Time with Power BI (mssqltips.com)

Rolling 12 Months Average in DAX - SQLBI

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

weeknum =
CALCULATE (
    SUM ( 'Table 2'[value ),
    FILTER (
        ALL ( 'Table 2' ),
        YEAR ( 'Table 2'[Date] ) = YEAR ( TODAY () )
            && 'Table 2'[Week] = WEEKNUM ( TODAY (), 1 )
    )
)

Similar to the ringgit, the growth over the same period can be referred to the following formula:

last week = CALCULATE([Amount_filter],DATEADD(M_DimDate[Date],-1,Week))

last week_amount =
VAR Pervious = [last week]
VAR diff =
    SUM ( FactInternetSales[SalesAmount] ) - Pervious
RETURN
    DIVIDE ( diff, Pervious, BLANK () )

vhenrykmstf_0-1659926792130.png

 

For more details, you can read below blog:

Calculate Percentage Growth Over Time with Power BI (mssqltips.com)

Rolling 12 Months Average in DAX - SQLBI

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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