Forum Discussion

manisharora's avatar
manisharora
Regular Visitor
10 years ago
Solved

Creating new column

Hi Team,

 

I have two table :- one is Product and 2nd is Order table.  We have UNIT COST field from Product table and QUANTITY field

from Order Table..

 

My requirment is to create a new column that would be named as "COST" that is formulated as (UNIT COST*QUANTITY)..

How can i get this column.....  please help me to resolve it..

 

Thanks

Manish Arora

 

 

  • I imagine the Product table has one line item for each product. If that's the case, you can create a relationship between the Product table and Order table on the product identifier, e.g., ProductID, or whatever uniquely identifies the product. Look for the Manage Relationships button in the Home tab of the ribbon to get started with the relationship.

     

    Once that's complete, you can create your new column in your Order table as

     

    COST = RELATED(ProductTableName[UNIT COST]) * [QUANTITY]

      

4 Replies

  • KGrice's avatar
    KGrice
    Memorable Member

    I imagine the Product table has one line item for each product. If that's the case, you can create a relationship between the Product table and Order table on the product identifier, e.g., ProductID, or whatever uniquely identifies the product. Look for the Manage Relationships button in the Home tab of the ribbon to get started with the relationship.

     

    Once that's complete, you can create your new column in your Order table as

     

    COST = RELATED(ProductTableName[UNIT COST]) * [QUANTITY]

      

    • manisharora's avatar
      manisharora
      Regular Visitor

      Thanks. GRice...it's working.. :smileyhappy:

       

      Best Regards

      Manish Arora

  • hi..i am new to Power BI and also to this forum.

     

    i am trying to create a new column by giving a condition as if segment(an existing column) contains  mid, emerging and so on

    the values of the segment column are mid, emerging, large etc. but still its not working. is the condition case senitive? how do we write mid, emerging??

  • Hi..i am new to power BI as well as new to this forum.

     

    I am trying to create a new column by using an existing column in the conditional column formula

    i am using if segment (existing column) contains mid, emerging then so n so

     

    the values of segment column are mid, emerging and large and strategic. still i am not gettig the exact result. is the condition thing case sensitive?