Last Invoice Date and Value

JEB85

Board Regular
Joined
Aug 13, 2010
Messages
238
Hi

My powerpivot data, simplistically, is set up like so:

DateCustomerValue
01/01/2014A261
01/01/2014B127
01/01/2014C203
01/02/2014A402
01/02/2014B127
01/02/2014C203
01/02/2014D560
01/03/2014A261
01/03/2014A-261
01/03/2014C203
01/03/2014D400

<colgroup><col style="text-align: center;"><col span="2" style="text-align: center;"></colgroup><tbody>
</tbody>


My goal is to:
Find the date the customer was last invoiced
Where the net invoice value is greater than 0
Also bring back the associated value

The desired result would be as follows:

Measures
CustomerDateValue
A01/02/2014402
B01/02/2014127
C01/03/2014203
D01/03/2014400

<colgroup><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"></colgroup><tbody>
</tbody>

Is this possible? Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
likely that LASTNONBLANK is going to help you here. It returns the max value in the first param (your date), where some expression is not BLANK, so you need to write that 2nd param to return blanks as appropriate.

Easiest if you precalc the Net Invoice in a calc column:
=LASTNONBLANK(MyTable[Date], MyTable[Net Invoice] > 0)

But also doable in a measure, just trickier :)
 
Upvote 0
Hi Scottsen,

How do you create the net invoice calc column?

I know how to do this in regular excel but not sure how to do it in powerpivot.

Thanks
 
Upvote 0
Hi,

I've tried that formula and it yielded the following:

=CALCULATE(SUM(Table1[Value]),ALL(Table1),Table1[Customer]=EARLIER(Table1[Customer]),Table1[Date]<=EARLIER(Table1[Date]))


DateCustomerValueNetInvoiceTest
01/01/2014 00:00:00A261261
01/01/2014 00:00:00B127127
01/01/2014 00:00:00C203203
01/02/2014 00:00:00A402663
01/02/2014 00:00:00B127254
01/02/2014 00:00:00C203406
01/02/2014 00:00:00D560560
01/03/2014 00:00:00A261663
01/03/2014 00:00:00A-261663
01/03/2014 00:00:00C203609
01/03/2014 00:00:00D400960

<tbody>
</tbody>

So it looks like it's doing a cumulative calculation?

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,167
Members
448,870
Latest member
max_pedreira

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