Forum Discussion

joschultz's avatar
joschultz
Advocate II
10 years ago
Solved

New Measure

 

 

How can I sum one specifice product in a column?  So for instance I have two columns.  One is the product name and the other is the sales.  I need to total the sales just one specfic product in the column.

 

Thank you,

 

Joseph

  • In any sort of visualization that has 'Table'[ProductName] as a legend, row, column, or axis label, that filtering will be done automatically.

     

    If you just need a measure that is filtered by default, use CALCULATE():

     

    SumSpecificProduct:=
    CALCULATE(
        SUM('Table'[Sales])
        ,'Table'[ProductName] = "<specific product name>"
    )

5 Replies

  • Hi Joseph,

     

    Depending on what you want to do, you have a few options:

     

    One option is the calculate function:

    measure = calculate(sum[sales],filter(table,table[product]="Product 1"))

     

    You could also just take the sum of sales and use a product slicer. Select the product you want to see sales for.

     

    Finally, you could use a report-level, page-level, or chart-level filter to only show the specific product you want to see.

    • greggyb's avatar
      greggyb
      Resident Rockstar

      SUMX() and FILTER() both force single threaded evaluation.

  • greggyb's avatar
    greggyb
    Resident Rockstar

    In any sort of visualization that has 'Table'[ProductName] as a legend, row, column, or axis label, that filtering will be done automatically.

     

    If you just need a measure that is filtered by default, use CALCULATE():

     

    SumSpecificProduct:=
    CALCULATE(
        SUM('Table'[Sales])
        ,'Table'[ProductName] = "<specific product name>"
    )
  • I would just create the measure for Total Sales, and then use a slicer to look at a specific product.