Forum Discussion

Krishnan_47's avatar
Krishnan_47
Helper I
4 years ago
Solved

Total Value in Measure

Hi All,

 

I have a table with three columns (Country, Col1 and Col2). I need to multiply the columns Col1 and Col2. I have used a measure to multiply but this is also getting multiplied for Total Row as well. In Total row, the values in each column should get added.

 

CountryCol1Col2My MeasureExpected Measure 
Aus1505050
NZ2100200200
Total3150450250

 

Please help in letting me know how to create a measure where the multiplication should not happen in Total Row.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Krishnan_47 ,

     

    I think you can try this code to create a measure.

    Sum Multiply =
    VAR _ADD_Multiply =
        ADDCOLUMNS ( 'Table', "Multiply", 'Table'[Col1] * 'Table'[Col2] )
    RETURN
        SUMX ( _ADD_Multiply, [Multiply] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Krishnan_47 ,

     

    I think you can try this code to create a measure.

    Sum Multiply =
    VAR _ADD_Multiply =
        ADDCOLUMNS ( 'Table', "Multiply", 'Table'[Col1] * 'Table'[Col2] )
    RETURN
        SUMX ( _ADD_Multiply, [Multiply] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.