Forum Discussion
Connect two datasets and retrieve last value
- 4 years ago
Hi Anonymous
It's possible to get the latest value in another table. According to the Product name of the current row, go to another table to find the value of the latest date of the same product name.
e.g. create the the measure
get the latest close_price = VAR _latestDate = CALCULATE ( MAX ( Table2[Date] ), FILTER ( ALL ( Table2 ), Table2[Ticker] = MIN ( Table1[Product] ) ) ) RETURN CALCULATE ( MAX ( Table2[close_price] ), FILTER ( ALL ( Table2 ), Table2[Date] = _latestDate && Table2[Ticker] = MIN ( Table1[Product] ) ) )Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
It's possible to get the latest value in another table. According to the Product name of the current row, go to another table to find the value of the latest date of the same product name.
e.g. create the the measure
get the latest close_price =
VAR _latestDate =
CALCULATE (
MAX ( Table2[Date] ),
FILTER ( ALL ( Table2 ), Table2[Ticker] = MIN ( Table1[Product] ) )
)
RETURN
CALCULATE (
MAX ( Table2[close_price] ),
FILTER (
ALL ( Table2 ),
Table2[Date] = _latestDate
&& Table2[Ticker] = MIN ( Table1[Product] )
)
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.