Forum Discussion

Peter_2020's avatar
Peter_2020
Helper III
2 years ago
Solved

Lookup function

Hi all,    I would like to ask you for your help with following situation: I have database with lot of data about the production orders (TABLE1). Each specific order has info about the project, op...
  • Wilson_'s avatar
    Wilson_
    2 years ago

    Peter,

     

    Try this instead (instead of matching on the exact date, it matches on the month):

    VALUE = 
    VAR SelOperation = SELECTEDVALUE ( ProductionData[OPERATION] )
    VAR SelMonth = MONTH ( SELECTEDVALUE ( ProductionData[REPORTED DATE] ) )
    VAR Result =
    CALCULATE ( 
        SUM ( Table2[Value] ),
        Table2[OPERATION] = SelOperation,
        MONTH ( Table2[Table Date] ) = SelMonth
    )
    
    RETURN Result

     


    ----------------------------------
    If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)