Blanks in DAX cumulative sum

Bloch1811

New Member
Joined
Oct 9, 2017
Messages
2
Hi

I’m trying to make an cumulative sum of production quantities throughout the year.

I have created a DAX measure in PowerPivot that works fine on the totals as illustrated in the below table, however, on the detailed level I get blanks which causes issues when I want to compare the YTD figure for May with the YTD figure for October on a detailed level.

My DAX formula looks like this:
Actual Production:=IF(MIN('SCP calendar'[SCP Date])<=CALCULATE(MAX(Actual_Production[Date]);ALL(Actual_Production)); CALCULATE(SUM(Actual_Production[Qty in BC or Pack]);FILTER(ALL('SCP calendar'[SCP Date]);'SCP calendar'[SCP Date]<=MAX(Actual_Production[Date]))))

[Actual Production] is a transaction table of with production data
[SCP calendar] is the calendar table.

JanFebMarAprMayJunJulAugSepGrand total
Product group 15152832405062687171
Product A461010
Product B5122020
Product C561216222832384171
Grand Total5152832405062687171

<tbody>
</tbody>



Anyone who have an idea on how I get the previous months figure repeated in the blank cells?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi gazpage

Thank you for taking your time to answer. The TOTALYTD function gave the same issues as the formula I had.

However, I found a solution using the formula below:

Actual prod - cumulative :=
CALCULATE (
SUM ( Actual_Production[Qty in BC or Pack] );
FILTER (
ALLSELECTED ( Actual_Production );
AND (
Actual_Production[Date] <= MAX ( 'SCP calendar'[SCP Date] );
YEAR ( Actual_Production[Date] ) = YEAR ( MAX ( 'calendar'[Date] ) )
)
);
VALUES ( MasterData )
)

The key was to add the VALUES-section with the table I use to split up the total.
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top