Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Share adjustment price =
VAR _INDEX = MAX('Investment'[Index])
VAR _INDEX_1 = _INDEX - 1
VAR a = SUMX('Investment', 'Investment'[Qty])
VAR b = SUMX('Investment', 'Investment'[Price])
VAR c = [Closing Share]
VAR d =
CALCULATE (
[Closing Share],
'Investment'[Index] = _INDEX_1
)
VAR e = (b * a) / c
RETURN
RETURN
SWITCH(
TRUE(),
'Investment', 'Investment'[Transaction Type] = "Shares Adjustment", e,
0
)
Solved! Go to Solution.
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
Hi @praveenjujare ,
Based on the DAX you provided, I’m not able to fully understand the calculation logic for this new column. Could you please describe the calculation logic for this column in words?
Best Regards,
Bof
When transaction type = share adjustment then (previous row of price * previous row of closing share )/ present row of closing share
Example: (65.4 * 273000)/2730000
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
Thanks sir
please shere more detail or pbix file.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |