cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slav84
Frequent Visitor

How to calculate weekly running total

Hi, 
I have table called WeeklyData with columns FiscalWeek and Count. 
I need to add another column (Not Measure)  that will have running totals. So for example in row of RunningTotal we would have 132, row two would be 132+654 and so on.
How would i do that ?

FiscalWeekCount
1132
2654
3987
4498
5658
6738
7918
8658
9468
10681
1195
12128
13642
14379
15728
16291
17675
1 ACCEPTED SOLUTION
mahoneypat
Super User IV
Super User IV

Here is a column expression that works.  Replace T1 with your actual table name.

 

RT =
VAR thisFW = T1[FiscalWeek]
RETURN
    SUMX ( FILTER ( T1, T1[FiscalWeek] <= thisFW ), T1[Count] )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Super User IV
Super User IV

Here is a column expression that works.  Replace T1 with your actual table name.

 

RT =
VAR thisFW = T1[FiscalWeek]
RETURN
    SUMX ( FILTER ( T1, T1[FiscalWeek] <= thisFW ), T1[Count] )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Thank you. This worked like charm 😉

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors