Forum Discussion

mlmagl14's avatar
mlmagl14
Icon for Helper I rankHelper I
4 years ago
Solved

Pulling multiple results from one column

I have a sales report and one of the columns list all our vendors. I'd like to calculate the total profit of two of the vendors, but I don't know how to enter the correct dax to pull more than one ve...
  • rsbin's avatar
    4 years ago

    mlmagl14 ,

    The double pipe is used as an "OR" condition.  Please try something like this:

    Gross Profit = CALCULATE(SUM('Table'[Profit]),
                             FILTER( Table, 'Table'[Product Vendor] = "Vendor 1" ||
                                      'Table'[Product Vendor] = "Vendor 2" ))
    

    If you have multiple Vendors, you can also make use of the "IN" function.

    Hope this helps.

    Regards,