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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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