Forum Discussion

chandra's avatar
chandra
Frequent Visitor
10 years ago
Solved

TABLE NOT SHOWING UP in CALCULATION

Data model

Am trying to create a column SALESPRICE in ORDER_ITEM TABLE. Required formula = ORDER_ITEM(QUANTITY) * ITEM(RETAIL_PRICE).

 

I am getting the following error, can you pls help. The order_ITEM table is connected to ITEM table through ITEM_ID

 

  • chandra Syntax for creating calculated column should be,

     

    Column = 'TABLENAME'[COLUMNNAME] * 'TABLENAME'[COLUMNNAME]

  • chandra

     

    As ankitpatira said, you should add you calculated column with expression like:

    SalesPrice= 'ORDER_ITEM'[QUANTITY] * 'ITEM'[RETAIL_PRICE]

     

    If you still can't call the columns properly, please use RELATED() function.

     

    In DAX, parenthesis () is only used after a function. To call a column, you should use brackets [].

     

    For more information, please see: DAX Syntax Reference

     

    Regards,

3 Replies

  • ankitpatira's avatar
    ankitpatira
    Icon for Community Champion rankCommunity Champion

    chandra Syntax for creating calculated column should be,

     

    Column = 'TABLENAME'[COLUMNNAME] * 'TABLENAME'[COLUMNNAME]

  • v-sihou-msft's avatar
    v-sihou-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    chandra

     

    As ankitpatira said, you should add you calculated column with expression like:

    SalesPrice= 'ORDER_ITEM'[QUANTITY] * 'ITEM'[RETAIL_PRICE]

     

    If you still can't call the columns properly, please use RELATED() function.

     

    In DAX, parenthesis () is only used after a function. To call a column, you should use brackets [].

     

    For more information, please see: DAX Syntax Reference

     

    Regards,

    • chandra's avatar
      chandra
      Frequent Visitor

      @ankitpatra @Simon_Hou

      Thanks for your suggestion.... the syntax worked. However, I am still having issues to calculate the sales price. 

       

      Same data model... 

      Pls see below the sample screen shot from both tables and what I am trying to calculate.

       

      In ORDER ITEM Table, I want the SalesPrice = 'Order_Item'[QUANTITY] * 'ITEM'[RETAIL_PRICE].

       

      Each Item has only one price in the ITEM table. In this case for Item_ID 52 = SALESPRICE Should be 5(QTY) X 321 (RETAIL_PRICE) = 1605 

       

      when I give the above formula Power BI says RETAIL PRICE has many values so forces me to select MIN,MX or SUM (which applied to the whole column). The MIN price value in the table is 2 so it calculated the value 5 x 2 = 10 which is wrong. 

       

      My ultimate goal is to have sales_price in some table but prefer it in Order_Item table....