PowerPivot need repeat values by date

macfuller

Active Member
Joined
Apr 30, 2014
Messages
319
Office Version
  1. 365
Platform
  1. Windows
I am trying to duplicate values for dates when all I have is the start date. It's a SUM of all relevant volume but not cumulative since I don't want to add from the prior month.

I receive a row value showing weekly quantity processed by start date. I also have a standard date table with every date in the range.

Customer Volume Start Date
A 20,000 5/1/2017
B 10,000 5/1/2017
A 5,000 8/1/2017
C 10,000 10/1/2017

I would like the result to be a pivot table showing the total volume for each month

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2017
[/TD]
[TD]2018
[/TD]
[/TR]
[TR]
[TD]Jan
[/TD]
[TD][/TD]
[TD]45,000
[/TD]
[/TR]
[TR]
[TD]Feb
[/TD]
[TD][/TD]
[TD]45,000
[/TD]
[/TR]
[TR]
[TD]Mar
[/TD]
[TD][/TD]
[TD]45,000
[/TD]
[/TR]
[TR]
[TD]Apr
[/TD]
[TD][/TD]
[TD]45,000
[/TD]
[/TR]
[TR]
[TD]May
[/TD]
[TD]30,000
[/TD]
[TD]45,000
[/TD]
[/TR]
[TR]
[TD]Jun
[/TD]
[TD]30,000
[/TD]
[TD]etc
[/TD]
[/TR]
[TR]
[TD]Jul
[/TD]
[TD]30,000
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Aug
[/TD]
[TD]35,000
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sep
[/TD]
[TD]35,000
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Oct
[/TD]
[TD]45,000
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Nov
[/TD]
[TD]45,000
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dec
[/TD]
[TD]45,000
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

How can I write a DAX measure to provide the numbers? I would also like to have other derived measures (e.g. cost per unit) based on the volume totals.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Just to verify, the standard Cumulative pattern adds the prior month instead of duplicating it. So

Code:
Cumulative Production:=
[SIZE=1][COLOR=#008000][SIZE=1][COLOR=#008000]CALCULATE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] ([/SIZE]
[SIZE=1]    [Monthly Production],
[/SIZE][SIZE=1][COLOR=#008000][SIZE=1][COLOR=#008000]FILTER[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] ([/SIZE]
[SIZE=1][COLOR=#008000][SIZE=1][COLOR=#008000]ALL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] ( 'Calendar'[Date] ),[/SIZE]
[SIZE=1]        'Calendar'[Date] <= 
[/SIZE][SIZE=1][COLOR=#008000][SIZE=1][COLOR=#008000]MAX[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=1] ( 'Calendar'[Date] )[/SIZE]
[SIZE=1]    )
)
[/SIZE]
Would generate $30,000 in May 2017, $60,000 in June, etc.

I may have to write a macro to "spread" the initial values into a weekly or monthly set of rows for the term of the facility's production run and then import that as a table, but surely there's a simple DAX measure for this...?
 
Upvote 0
This measure does what I intended, but the nuances of having to use CALCULATETABLE are beyond me.

Code:
Monthly Forecast Pieces:=SUMX (
    CALCULATETABLE (
        tblPounds,
        FILTER (
            tblPounds,
            tblPounds[Start Date] <= MAX ( 'Calendar'[Date] )
        )
    ),
    tblPounds[Monthly Pieces]
)
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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