Forum Discussion

AishwariyaV's avatar
AishwariyaV
Helper IV
7 years ago

Column is not showing correct value

Hi all,

I have price and quantity columns in my report. I have calculated sales by multiplying price and quantity. When i am multiplying them in a measure, the sale value is showing correctly. But when multiplying them in a column, the sales value is incorrect.

5 Replies

  • AishwariyaV can yu share the expression you use for column? Do you have aggregation on column when you dropped it in table visual?

    • AishwariyaV's avatar
      AishwariyaV
      Helper IV
      sale = (Order_Details[Quantity])*(Order_Details[UnitPrice]) 
  • sdjensen's avatar
    sdjensen
    Solution Sage

    AishwariyaV,

     

    As I see it both your column and measure is wrong - look at the total of your measure it's calculated as the sum of all UnitPrice and sum of all Quantity - to fix this you should use

    sumx(TableName', 'TableName'UnitPrice * 'TableName'Quantity)

    • AishwariyaV's avatar
      AishwariyaV
      Helper IV
      Column 4 = sumx(
      'Order_Details', 'Order_Details'[UnitPrice] * Order_Details[Quantity])
      It it showing incorrect value even after using sumx
      • Anonymous's avatar
        Anonymous
        Not applicable

        HI AishwariyaV ,

        Actually, when you use measure in a calculated column, its calculation result will been fixed as static value and did not dynamic changes based on current row contents.(measure row content will be fixed as whole table)

        Please use measure to calculate with formulas who invoke both column and measures.

        Regards,

        Xiaoxin Sheng