# Powerpivot Calculation column

#### nd0911

##### Board Regular
Hello,

I have two tables in powerpivot and I need a calculation formula.

Im new with the PowerPivot world so please be gentle with me.

My data looks like that:

table1:
uniq order number | order price
1 | 500\$
2 | 300\$
3 | 100\$
4 | 250&

table2:
order number | Time
3 | 1.5
3 | 2
1 | 5.2
2 | 2.33
1 | 4.5
4 | 1.22
3 | 1

I want to add a calculation column to table 2 that calculat the price for the relative record.
for example: the first record in table 2 sould return 22.2222

My calculation:
100/(1.5+2+1)*(Time column - first row)

* The "Time" column is the "time*24" (example: 02:30*24 = 2.5)

Thank you!

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### Matt Allington

##### MrExcel MVP
You should not write a calculated column. Read my article here Calculated Columns vs Measures in DAX - Excelerator BI

Create a third table that contains all the unique order numbers. Join the 2 tables you have already to the new table. Create a pivot table and place the order number from the new table in the pivot on rows.

I can't understand the logic of your formula as written, but you can write a measure something like this

=sum(table2[time]) *max(table1[order price])

Replies
2
Views
178
Replies
9
Views
293
Replies
0
Views
179
Replies
0
Views
419
Replies
1
Views
737

1,190,774
Messages
5,982,842
Members
439,799
Latest member
matts12

### 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.

### Which adblocker are you using?

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

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