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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Cummulative sum by week for bar graph

Hi guys,

 I need cummulative sum of "Quantity" as per week.

eg week 1

    week2=week2+week3......

so far

Problem here is ,source gives the one amount for whole month,which we have broken down in 30 days.(cummulative will result in final result).But not able to break it week wise to get  weekly cummulative sum.I have alreday tried below DAX function  which does not work.

Cumulative Quantity =
CALCULATE (
    SUM ( (quantity]),
    FILTER (
        ALL ( 'Date'[Date] ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
    )
)

 

 

DatequantityYearMonthYear Month
Tuesday, May 1, 20188302018520185
Friday, June 1, 201812002018620186
Sunday, July 1, 2018252018720187
Wednesday, August 1, 201852018820188
Saturday, September 1, 201838002018920189
Monday, October 1, 2018100201810201810
Thursday, November 1, 20181400201811201811
Saturday, December 1, 20183345201812201812
Saturday, December 1, 201855201812201812

 

structure:

Table 1 joined with DATE table

 

Any suggestion would be appreciated.

 

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

Could you please share the expected result and the target visual to us? I can't understand your requirement very well. Why will "week2=week2+week3......", besides, your sample data are all the first day of each month rather than a week.

Generally, when we want to get the cummulative sum of data in a week, for example, monday it will display monday, Tuesday displays the sum of Monday and Tuesday, we will create a week column in the calendar table.

Best Regards,

Teige

Anonymous
Not applicable

 

quantity.PNG

 

 

 

 

 

 

 

Basically we get data for first day of the month which is  eg.14000000,which we break into month days to display the line graph.

Now problem here is we have to break the amount week wise to display it as cummulative sum.@cha

 

 

 

 

 

 

 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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