Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Hi Guys

I need to find out the following please;    Reference Table; Customer Number MRDR number  Price Valid from: Price Valid to:  Promo NIV/Case   11111 12345 10/01/2019 15/02/2019 0.42 ...
  • v-lid-msft's avatar
    6 years ago

    Hi Anonymous ,

     

     We can create a calculated table to get the matched value:

     

    Column = 
    CALCULATE (
        MAX ( 'Table 2'[Subtotal 4 = NIV] ),
        FILTER (
            'Table 2',
            'Table 2'[Customer L8] = [Customer Number ]
                && 'Table 2'[Pricing entry date] >= [Price Valid from]
                && 'Table 2'[Pricing entry date] <= [Price Valid to]
        )
    )

     

     


    Best regards,

     

  • Anonymous's avatar
    Anonymous
    6 years ago

    v-lid-msft , Thank you for your reply, please i noticed you didnt use referance table in your query. when I applied your requery I get an error. 

     

    Note your query in table 1 (reference table) is not used in the query to link the two tables


    = CALCULATE
    ( MAX
    ( 'Table 2'[Subtotal 4 = NIV] ), FILTER ( 'Table 2', 'Table 2'[Customer L8] = [Customer Number ]
    && 'Table 2'[Pricing entry date] >= [Price Valid from] && 'Table 2'[Pricing entry date] <= [Price Valid to]
    && 'Table 2'[Pricing entry date] = TODAY() + 1 ) )

     

    Thank you,

    Sarmad Dara