=calculate( sum(TB[Sales]) , DATESYTD(Calendar[Date]))

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
220
Good day,

In PowerPivot for Excel 2013:
Table "TB" has 3 fields: Date, Region, Sales
Table "Calendar" has only one field: Date (which list all dates for many years)
Then I created Calculated YTDSales=calculate( sum(TB[Sales]) , DATESYTD(Calendar[Date]))

My PowerPivot as as follow (a trended view by date of cumulative YTD sales):

YTDSales Date
Region Jan Feb Mar
East 1 * 2
West 1 2 3

* Empty cell
_____________________

Issue:
East made no sales in Feb. Cumulative sales are therefore 1. But the pivot table returns an empty cell simply because there are no sales in Feb!

Question:
How can I force the pivot table to show YTD sales in months in which there are no sales?

Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I just replicated your calculated field and it worked fine.

East 1 1 2
West 1 2 3

Assuming that west had a sale in each month. and east only had a sale in Jan and Mar

Are you sure your relationships are working? Or is there something else missing (ie another table or column involved?)
 
Upvote 0
I figured it ...
in the colum filter, I must place the Date field from the "Calendar" table...

Thanks one3nine0
 
Upvote 0

Forum statistics

Threads
1,224,118
Messages
6,176,482
Members
452,730
Latest member
palsmith

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