Forum Discussion
praveenjujare
Helper I
1 year agoNeed help creating new column
Share adjustment price = VAR _INDEX = MAX('Investment'[Index]) VAR _INDEX_1 = _INDEX - 1 VAR a = SUMX('Investment', 'Investment'[Qty]) VAR b = SUMX('Investment', 'Investm...
- Anonymous1 year ago
Hi praveenjujare ,
Pease try:
Column = IF( 'Investment'[Transaction Type] = "Shares Adjustment", VAR PreviousRowPrice = CALCULATE( MAX('Investment'[Price]), FILTER( 'Investment', 'Investment'[Index] = EARLIER('Investment'[Index]) - 1 ) ) VAR PreviousRowClosingShare = CALCULATE( MAX('Investment'[Closing Share]), FILTER( 'Investment', 'Investment'[Index] = EARLIER('Investment'[Index]) - 1 ) ) RETURN (PreviousRowPrice * PreviousRowClosingShare) / 'Investment'[Closing Share], BLANK() )Best Regards,
Bof
praveenjujare
Helper I
1 year agoWhen transaction type = share adjustment then (previous row of price * previous row of closing share )/ present row of closing share
Example: (65.4 * 273000)/2730000
Anonymous
1 year agoNot applicable
Hi praveenjujare ,
Pease try:
Column =
IF(
'Investment'[Transaction Type] = "Shares Adjustment",
VAR PreviousRowPrice = CALCULATE(
MAX('Investment'[Price]),
FILTER(
'Investment',
'Investment'[Index] = EARLIER('Investment'[Index]) - 1
)
)
VAR PreviousRowClosingShare = CALCULATE(
MAX('Investment'[Closing Share]),
FILTER(
'Investment',
'Investment'[Index] = EARLIER('Investment'[Index]) - 1
)
)
RETURN
(PreviousRowPrice * PreviousRowClosingShare) / 'Investment'[Closing Share],
BLANK()
)
Best Regards,
Bof
- praveenjujare1 year ago
Helper I
Thanks sir