Forum Discussion

Yonatan1984's avatar
Yonatan1984
Helper I
4 years ago
Solved

Search Part Cost

Hello to everyone! I'm trying to see the part cost rate of my Factory. I've an table from the DB that there is all the costs of all parts of the factory. There are item numbers that appear several...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    Yonatan1984 

     

    If the field types of the two tables are synchronized, it does not matter whether text or number.

    Try this:

    Column = 
    VAR a =
        MAXX (
            FILTER (
                PART_COST_RATE,
                [PART_CODE] = EARLIER ( 'Table'[PART_CODE] )
                    && [EFECT_FROM_DATE] <= EARLIER ( 'Table'[MANUFACTURE DATE] )
            ),
            [EFECT_FROM_DATE]
        )
    RETURN
        MAXX (
            FILTER (
                PART_COST_RATE,
                [EFECT_FROM_DATE] = a
                    && [PART_CODE] = EARLIER ( 'Table'[PART_CODE] )
            ),
            [RATE]
        )
    

    Are you sure there are matching results in the two tables?

     

    Best Regards,
    Community Support Team _ Janey