PowerPivot SAMEPERIODLASTYEAR Error

jcgilbertson

New Member
Joined
Dec 16, 2015
Messages
8
I am trying to create a year over year comparison of quarterly revenue based on a single table pulling from SQL. When I try to add a calculated column with =SAMEPERIODLASTYEAR([InvoiceDate]) I receive a "#ERROR" error. Here is the error detail:

Column 'InvoiceDate' cannot be found or may not be used in this expression.

If anyone has thoughts on why this might be they would be appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Keep in mind that the Dax Time Intelligence functions work by shifting the dates visible in the current filter context, not be performing math on the [InvoiceDate] column. Plus SAMEPERIODLASTYEAR returns a single column table of values, not an individual scalar value which is why you are getting the error.

Power Pivot is an aggregation and summarizing tool so you don't want to create a calculated column in this situation anyway, but rather a measure. Also since you want to use a Time Intelligence function a for sure best practice is to have a separate Calendar table that is related to this table via the [InvoiceDate] field. If you are new to Power Pivot/Dax there is most definitely a learning curve to all this but worth it in my opinion.
I know this post is not too helpful, but way to much to cover here. If you post some sample data and what you want the end result to look like someone can help which may get you started.
 
Upvote 0

Forum statistics

Threads
1,215,373
Messages
6,124,549
Members
449,170
Latest member
Gkiller

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