Forum Discussion

baronraghu_3011's avatar
baronraghu_3011
Frequent Visitor
3 years ago
Solved

Lookupvalue trouble

Hi All,   I need to pickup the last traded price of a particular stock into a new table   Table 1  has last 5 years historic data of stock - ABC  Table 2 has list of stock names   i was trying...
  • Barthel's avatar
    Barthel
    3 years ago

    baronraghu_3011 
    Could it be that there are multiple transactions in one day for a stock name? If there is more than one transaction, it cannot be converted to a scalar value. If this is the case, you can take the maximum stock price per day, for example.

    last traded price of stock =
    CALCULATE (
        MAX ( Table1[Stock Price] ),
        Table1[Date]
            = TODAY () - 1,
        ALLEXCEPT ( Table2, Table2[Stock Name] )
    )