Forum Discussion
leolapa_br
1 year agoResolver II
Get First Value From A Column
Hi have a table called "StockQuotes" that looks like this: I wrote the following code as an attempt to fetch the first available (from the earliest date) Close Price for each respective stock ...
- 1 year ago
ChatGTP came to the rescue here and produced the following code that solved the issue:
First Close = CALCULATE( FIRSTNONBLANK(StockQuotes[Close Price], 1), FILTER( ALL(StockQuotes), StockQuotes[Ticker] = SELECTEDVALUE(StockQuotes[Ticker]) && StockQuotes[Date] = CALCULATE( MIN(StockQuotes[Date]), ALLEXCEPT(StockQuotes, StockQuotes[Ticker]) ) ) )
leolapa_br
1 year agoResolver II
ChatGTP came to the rescue here and produced the following code that solved the issue:
First Close =
CALCULATE(
FIRSTNONBLANK(StockQuotes[Close Price], 1),
FILTER(
ALL(StockQuotes),
StockQuotes[Ticker] = SELECTEDVALUE(StockQuotes[Ticker]) &&
StockQuotes[Date] =
CALCULATE(
MIN(StockQuotes[Date]),
ALLEXCEPT(StockQuotes, StockQuotes[Ticker])
)
)
)