PowerPvot Sales Without Gap

m1nkeh

New Member
Joined
Jul 28, 2014
Messages
30
Hi,

Trying to calc sales in the last 12 months "without gap", as in... if customer purchased one item in each of Jan, Feb, and Apr .. this measure would show a value of 1... (here my screenshot shows a value of 2 in Apr, but you get the idea)

WPOIJD7.png


So, i guess it should be something like this:

Code:
SalesNoBreak:=CALCULATE (
    [Sales],
    DATESBETWEEN (
        Dates[Date],
        DATE(2015, 03, 01),
        LASTDATE ( Dates[Date] )
    )
)

But i can't for the life of me how to work out how to "automate" the DATE(2015, 03, 01) portion...

Ty.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I'm not gonna lie... this one seems pretty tricky :)

I do think you are on the right track. Where you have DATE(2015, 03, 01)... that needs to be a calculation for "after the most recent month that had 0 sales"... for which, I bet you end up using LASTNONBLANK()
 
Upvote 0
looked at this for about 4 hours this morning, and have little more than simply knowing that i need to work first of the month in which the customer had no sales (EOMONTH() -1 or some variant), but i still cant get "LASTDATE() except for the actual last sale"... maybe i should mark it as a calc column in the table?? also makes me wonder what should happen when looking at all customers (i.e. not-filtered)

arghhh, thought of another issue now as when work out the last 12 months sales if there are no gaps, but that can probs be achieved with a simple IF()
 
Upvote 0
I'd play around with a measure like this:
Last Month with No Sales :=LASTNONBLANK(Calendar[Month], IF ([Sales] = BLANK(), 1))
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,517
Members
448,968
Latest member
Ajax40

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