Forum Discussion

Silver75's avatar
Silver75
Frequent Visitor
9 years ago
Solved

How can I multiply Measure per Column?

Hi everyone,

I'm building a report table similar to example

 

I need a new measure

new measure = Measure*Column.

 

Could you help me please?

thank you

 

  • Hi Silver75,



    The formula is ok but the grand total it's wrong

    Based on my experience, using SUMX function could make it work. The formula below is for your reference. :smileyhappy:

    New measure = SUMX ( 'TableNameOfProductDim', [Measure] * SUM ( [Column] ) )
    

    Note:  replace 'TableNameOfProductDim' with the real table name of your Product Dim table which contains a column of individual value of ID PRODUCT.

     

    Regards

10 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Is your "Measure" in your example a column or a Measure? If you need an actual measure, you will need to use an aggregation function like MAX, MIN or SUM like:

     

    MyMeasure = SUM([Measure])*SUM([Column])

    Otherwise, if Measure is an actual measure, then you shouldn't need the SUM for [Measure].

    • Silver75's avatar
      Silver75
      Frequent Visitor

      HI Greg_Deckler

      thank you for your solution.  Measure is an actual measure. The formula is ok but the grand total it's wrong

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        Yeah, that is not uncommon with measures. You generally have to do an IF with a HASONEFILTER or something along those lines to get the grand total to calculate correctly. Essentially, you can think of a measure in a grand total as your measure calculating in the context of ALL.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Greg,

      I have used the same formula to create Total Cost. I have used formula : 

      Total Cost = SUM(Sheet1[QtyShip])*sum(Sheet1[CuryCost])
      But Total Visualizaion Total Amount is showing wrong value. I could not able to insert image.
  • Anonymous's avatar
    Anonymous
    Not applicable

    Is this resolved. If so, how did you do it?