Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Return current value from LastNonBlank by date

Hi, I have a table "DividendStocks" and I need a column or measure like "Shares":  StockTicker Date Purchase Shares (what I need) PEP Jan 0 50 GILD Jan 0 200 SVK Jan 10...
  • v-xulin-mstf's avatar
    5 years ago

    Hi Anonymous,

     

    Try measure as:

    shares =
    
    CALCULATE(
    
        SUM(DividendStocks[Purchase]),
    
         FILTER(
    
             ALL(DividendStocks),
    
            DividendStocks[Date]<=MAX('Table'[Date]) &&  DividendStocks[Purchase]<>0 && DividendStocks[StockTicker]=MAX(DividendStocks[StockTicker]) && DividendStocks[StockTicker] <>""))

    Here is the output:

     

    Here is the demo, please try it: Return current value from LastNonBlank by date

     

    Best Regards,

    Link

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.