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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ahmoh43
New Member

weekly running total

ahmoh43_0-1712050101931.png

I want to make weekly trend as monthly trend 

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

Hi @ahmoh43 

Thanks for the solution @MFelix  provided, and i want to offer some information for you to refer to.

Sample data

vxinruzhumsft_0-1712294200734.png

 

 

Create a measure.

 

MEASURE =
CALCULATE (
    SUM ( 'Table'[Value] ),
    ALLSELECTED ( 'Table' ),
    'Table'[WeekNo] <= MAX ( 'Table'[WeekNo] )
)

 

Then put the  the measure to the y-axis.

Output

vxinruzhumsft_0-1713427741577.png

 

 

Best Regards!

Yolo Zhu

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

6 REPLIES 6
v-xinruzhu-msft
Community Support
Community Support

Hi @ahmoh43 

Thanks for the solution @MFelix  provided, and i want to offer some information for you to refer to.

Sample data

vxinruzhumsft_0-1712294200734.png

 

 

Create a measure.

 

MEASURE =
CALCULATE (
    SUM ( 'Table'[Value] ),
    ALLSELECTED ( 'Table' ),
    'Table'[WeekNo] <= MAX ( 'Table'[WeekNo] )
)

 

Then put the  the measure to the y-axis.

Output

vxinruzhumsft_0-1713427741577.png

 

 

Best Regards!

Yolo Zhu

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

 

 

 

 

MFelix
Super User
Super User

Hi @ahmoh43,

 

For this you need to create a cummulative measure that will allow to have the calculation for each week.

 

You can do a measure similar to this one:

Weekly Cumulative = CALCULATE (SUM(Table[Column]), Table[Week] >= MAX(Table[Week]))

Be aware that I'm assuming that you are only selecting a specific year for the visualization of the chart.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix - What if I wanted to do something similar comparing 2023-2024 by week but for the last 2 quarteres of the year? Can you add a filter for year as well?

Hi @SteffanieJ ,

 

Yes you can do that depending on the result you want to achieve you can add additional filter to the calculation to get the previous year values.

 

Depending on how you have the setup of your model you can do it using the DATEADD syntax for example or SAMEPERIODLASTYEAR or forcing the year to be equal to MAX(Year) - 1


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix - I have the date add formula in the 2023 and 2024 columns. Here are the formulas used last year but when I change them to -2 and -1 year and then change my created year to 2025 the running total column goes blank.

OD SO 2023 = CALCULATE([SO Total Sales Shipped/Open],DATEADD('EB Orders'[SO CrtnDate].[Date],-1,year))
OD SO 2024 = CALCULATE([SO Total Sales Shipped/Open],DATEADD('EB Orders'[SO CrtnDate].[Date],-0,year))
YOY Formula - 
OD SO Week Diff 2023-2024 = CALCULATE([OD SO 2024]-'EB Orders'[OD SO 2023])
Running total formula - 
OD SO Week Diff running total in Week 2023-2024 =
CALCULATE(
    [OD SO Week Diff 2023-2024],
    FILTER(
        ALLSELECTED('EB Orders'[Created On Week]),
        ISONORAFTER('EB Orders'[Created On Week], MAX('EB Orders'[Created On Week]), DESC)
    )
)
 

 

SteffanieJ_0-1735912394518.png

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Top Solution Authors
Top Kudoed Authors