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
BEENSGROEPADMIN
Frequent Visitor

Cummulative sum by one value till maximum

Hello,

 

The following table is relevant to know for this case.

1. Production quantities: this table lists a quantity of the total project per production activity:

BEENSGROEPADMIN_0-1668410054681.png

The first row contains production activities, the second contains the units, the third contains the total quantity of the production activity and the last contains the average cycle time of the production activity.

 

Another table lists the produced quantity of an production activity by week. 

I want to make an line-chart with two lines:

1. Is the cummulative sum of the registrated production quantity (this line already consists)
2. A line that sums one value of 'Doorlooptijdbegroting' (average cycle time) till the max of that production activity named 'Hoeveelheden' (total amount).
Example: 

one activity 'Aanbrengen damwanden (drukken)' has a total amount of 227 meters. The average cycle time is 56 meters per week. The line has to cummulate the 56 till it has reached the total amounto 227: 56+56+56+56+rest (3).

 

Note: Both tables are related to a date table with weeknumbers.

 

I am hoping some could help me! Thanks a lot.

 

Kind regards,

 

Admin BG

#cummulative #sum #datetable

 

2 REPLIES 2
BEENSGROEPADMIN
Frequent Visitor

Hello,

 

I've created the following measure based on your measures:

BEENSGROEPADMIN_1-1668516911628.png

 

The following line is generated by this measure:

BEENSGROEPADMIN_0-1668515242794.png

This line starts at the first week of the year. Now I want to start this line chart at the same moment when the first production activity is registrated. This date value is " 'table - productregistration'[when] ".

 

Do you know what I should change in this Measure? Maybe it is relevant to know the following date table:

BEENSGROEPADMIN_2-1668517013244.png

 

Thanks a lot for helping me out!

 

 

 

 

Syndicate_Admin
Administrator
Administrator

Hi, @Syndicate_Admin

I'm curious to know how your week chart relates to the data sheet. You can try the following methods.

Measure1 = 
Var _aver1=CALCULATE(MAX('Table'[Doorlooptijdbegroting]),FILTER(ALL('Table'),[Activiteit]="Aanbrengen damwanden (drukken)"))
Var _max1=CALCULATE(MAX('Table'[Hoeveelheden]),FILTER(ALL('Table'),[Activiteit]="Aanbrengen damwanden (drukken)"))
Var _runningsum=SUMX(FILTER(ALL(Week),Week[Week]<=SELECTEDVALUE(Week[Week])),_aver1)
Return
IF(_runningsum<=_max1,_runningsum,"descanso")
Measure2 = 
Var _aver1=CALCULATE(MAX('Table'[Doorlooptijdbegroting]),FILTER(ALL('Table'),[Activiteit]="Aanbrengen damwanden (trillen)"))
Var _max1=CALCULATE(MAX('Table'[Hoeveelheden]),FILTER(ALL('Table'),[Activiteit]="Aanbrengen damwanden (trillen)"))
Var _runningsum=SUMX(FILTER(ALL(Week),Week[Week]<=SELECTEDVALUE(Week[Week])),_aver1)
Return
IF(_runningsum<=_max1,_runningsum,"descanso")

vzhangti_1-1668492084763.png

If the result is different from what you expected, please tell more details.

Best Regards,

Community Support Team _Charlotte

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

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.