Powerpivot Calculation column

nd0911

Board Regular
Joined
Jan 1, 2014
Messages
129
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!
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Matt Allington

MrExcel MVP
Joined
Dec 18, 2014
Messages
1,222
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])
 

Watch MrExcel Video

Forum statistics

Threads
1,102,680
Messages
5,488,231
Members
407,632
Latest member
varunwalla

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top