PowerPivot Data Range between two sheets

successken

New Member
Joined
Oct 3, 2011
Messages
27
I am working four sheets within PowerPivot: Date Sheet (in order to establish the relationship between the two data sheets), Customer Sheet (a list of unique customer numbers again to further establish the relationship between the two data sheets), Service Data consisting a list of customer numbers, date of service and Sales Data consisting a list of customer numbers and date of sale and Job Type.

From the Service Data Sheet I added a column with the following formula to answer the question whether or not to customer purchased a product after receiving a service for that day and it works fine.

=CALCULATE(COUNTA('Sales Data'[Job Type]),'Sales Data'[Job Type]="Complete")


What I'm looking for is whether or not the customer purchase a product within 30 days from the date of receiving a service. I tried the following formula:

=CALCULATE(COUNTA('Sales Data'[Job Type]),'Sales Data'[Job Type]="Complete",'Sales Data'[orderdate]>('Service Data'[orderdate]-1))

I received the following error:

The expression contains multiple columns, but only a single column can be used in a Boolean expression that is used as a table filter expression.

Any guidance would be greatly appreciated! Thank you!!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I think it is some wierdness in the CALCUTLATE filter function that you can only have > a fixed number not another expression i.e. you can only use one column reference in the expression. To get round it try entering a complete filter expression like this:


=CALCULATE(COUNTA('Sales Data'[Job Type]),FILTER('Sales Data','Sales Data'[Job Type]="Complete" && 'Sales Data'[orderdate]>('Service Data'[orderdate]-1)))

Mike
 
Upvote 0

Forum statistics

Threads
1,215,693
Messages
6,126,246
Members
449,304
Latest member
hagia_sofia

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