Forum Discussion

yaya1974's avatar
yaya1974
Helper III
2 years ago
Solved

Nested IF or Filter

Multiplicaiton:  Dax code with filters, how to write code for a new column?   test = Weight1 * weight2 * Adj  ................filter by customer, filter by material, filter by channel (and maybe an...
  • rajendraongole1's avatar
    rajendraongole1
    2 years ago

    Hi yaya1974 - can you try below one.

    FilteredProduct =
    IF (
        AND (
            AND (
                'iftest'[CustomerID] = "CustomerA",  
                'iftest'[MaterialID] = "MaterialX"
            ),
            'iftest'[ChannelID] = "ChannelY"
        ),
        'iftest'[Weight1] * 'iftest'[Weight2] * 'iftest'[Adj],
        BLANK()  -- Returns blank if the filter criteria are not met
    )

     

    Hope it works.