Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am attempting to add two measures together to have a cumulative total. However, it is returning a gap in the line (red line on graph below) when I want the line to just continue on. As you can see in the graph the value for the combined cumulative total also restarts again after the month with no data.
What I am aiming for is that the line stays flat on 25 (value in example) for the month with 0 changes and then continue to increase (as the cumulative total should) for months where there is data.
Below is the code I have used to calculate the cumulative totals independent of one another:
# Actual Fitted Cumulative =
Var _Result =
CALCULATE(sum('Stock Movement Detail'[Qty]),FILTER(ALLSELECTED('Stock Movement Detail'), 'Stock Movement Detail'[Date Out]<=MAX('Stock Movement Detail'[Date Out])),'Stock Movement Detail'[Status To]="Fitted")
Return _Result
Forecast Cumulative =
Var _Result =
CALCULATE(sum('Forecast Fitment'[Forecast Use]),FILTER(ALLSELECTED('Forecast Fitment'), 'Forecast Fitment'[ChangeDate (Year > Month > Day)]<=MAX('Forecast Fitment'[ChangeDate (Year > Month > Day)])))
Return _Result
Below is the forumla I attempted to use to return the cumulative total of the measures combined.
Cumulative of Fitments and Future Forecast =
[# Actual Fitted Cumulative] + [Forecast Cumulative]
Any help with this would be much appreciated.
Solved! Go to Solution.
@Anonymous , You should use a common date's column on axis and formula
Try like
# Actual Fitted Cumulative =
Var _Result =
CALCULATE(sum('Stock Movement Detail'[Qty]),FILTER(ALLSELECTED('Date'), 'Date'[Date]<=MAX('Date'[Date])),Filter('Stock Movement Detail', 'Stock Movement Detail'[Status To]="Fitted")
Return _Result
Forecast Cumulative =
Var _Result =
CALCULATE(sum('Forecast Fitment'[Forecast Use]),,FILTER(ALLSELECTED('Date'), 'Date'[Date]<=MAX('Date'[Date])))
Return _Result
@Anonymous , You should use a common date's column on axis and formula
Try like
# Actual Fitted Cumulative =
Var _Result =
CALCULATE(sum('Stock Movement Detail'[Qty]),FILTER(ALLSELECTED('Date'), 'Date'[Date]<=MAX('Date'[Date])),Filter('Stock Movement Detail', 'Stock Movement Detail'[Status To]="Fitted")
Return _Result
Forecast Cumulative =
Var _Result =
CALCULATE(sum('Forecast Fitment'[Forecast Use]),,FILTER(ALLSELECTED('Date'), 'Date'[Date]<=MAX('Date'[Date])))
Return _Result
Hi @amitchandak , I have been working on this and I have noticed when I adjusted my formula's one of the other measures is not working properly. I have tried several different ways to recalcualte it and I am hoping you can help.
I have the line on the graph (Actaul in dark blue) and I want the graph line to end when my last date for that for Stock Movement Detail ends (in this example it is June 2021). As you can see previously I have used that in my calculated measure (as outlined in my initial question) but that gave me gaps when there was no information for the month. Using points from your initial feedback I have adjusted my formula (as per below) but can not get the dark blue line to end when my data for Stock Movement Detail ends while maintaining a continuous line.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |