Forum Discussion
Create a custom column
- 2 years ago
sorry my bad,
create part_2 column :
part_2 = 1 + 'Table'[ROR]/ 100create mv column :
mv = SWITCH( TRUE(), not ISBLANK('Table'[Market Value]) , 'Table'[Market Value], var date_with_lastnonblank_market_value = sELECTCOLUMNS( LASTNONBLANK( FILTER( 'Table', 'Table'[Date]<=EARLIER('Table'[Date]) ), 'Table'[Market Value] ),'Table'[Date] ) var part_2 = SELECTCOLUMNS( WINDOW( 0, ABS, 0, REL , FILTER( SUMMARIZE( 'Table', 'Table'[Date], 'Table'[part_2] ) , 'Table'[Date] >=date_with_lastnonblank_market_value ), ORDERBY('Table'[Date],asc)), 'Table'[part_2] ) var market_value = sELECTCOLUMNS( LASTNONBLANK( FILTER( 'Table', 'Table'[Date]<=EARLIER('Table'[Date]) ), 'Table'[Market Value] ),'Table'[Market Value] ) var part_2_product = PRODUCTX(part_2, [part_2]) return market_value * part_2_product )let me know if this helps
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
Hi Daniel,
Thanks for your solution.
With the help of DAX formula you provided, I m getting Market Value and ROR data in one column.
However I want Derived market value data by multiplying ROR with previous Market Value.
In column B, Market value are missing for non-month end date, so I want to calculate those by multiplying previous market value with ROR.
Can you please help me with DAX custom column / measure?
sorry my bad,
create part_2 column :
part_2 =
1 + 'Table'[ROR]/ 100
create mv column :
mv =
SWITCH(
TRUE(),
not ISBLANK('Table'[Market Value]) , 'Table'[Market Value],
var date_with_lastnonblank_market_value =
sELECTCOLUMNS(
LASTNONBLANK(
FILTER(
'Table',
'Table'[Date]<=EARLIER('Table'[Date])
),
'Table'[Market Value]
),'Table'[Date]
)
var part_2 =
SELECTCOLUMNS(
WINDOW(
0,
ABS,
0,
REL ,
FILTER(
SUMMARIZE(
'Table',
'Table'[Date],
'Table'[part_2]
) , 'Table'[Date] >=date_with_lastnonblank_market_value
),
ORDERBY('Table'[Date],asc)),
'Table'[part_2]
)
var market_value =
sELECTCOLUMNS(
LASTNONBLANK(
FILTER(
'Table',
'Table'[Date]<=EARLIER('Table'[Date])
),
'Table'[Market Value]
),'Table'[Market Value]
)
var part_2_product = PRODUCTX(part_2, [part_2])
return market_value * part_2_product
)
let me know if this helps
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
- Daniel291952 years agoCommunity Champion
san_21 and sorry for the late response
i thought i did click on the reply button .
- san_212 years agoFrequent Visitor
Thanks Daniel for helping me with query.