Forum Discussion

admin11's avatar
admin11
Icon for Memorable Member rankMemorable Member
4 years ago
Solved

Error msg when i try to combine 2 column data into 1 column

Hi All

 

Yesterday  @ALLUREAN 
help me on below post

Today I try to create a expression :-

SEGMENT_M = 'SALES'[SEG] & 'SEGMENT'[SEGMENT_C]
 
Remark :- Above expression from 2 Table , SALES and SEGMENT Table
 
I get error msg :-
A single value for column 'SEGMENT_C' in table 'SEGMENT' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
 

The reason i need to combine SEG and SEGMENT_C is because now i need 2 Table , After successfully combine , i can use SEGMENT_M as Dimension. So only table required.

 

Paul

 

  • Hi,

    Try this calculated column formula

    SEGMENT_M_1 = if(SALES[SOURCE]="LE"||SALES[SOURCE]="SD"||SALES[SOURCE]="PW"||SALES[SOURCE]="PM"||SALES[SOURCE]="DA",'SALES'[SEG] & LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG]),LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG]))

18 Replies

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

    You're getting the error because you're trying to combine two columns from different tables.

     

    Assuming the tables are related:

    Segment 1 => Many Sales

     

    try the following dax:

    SEGMENT_M = 'SALES'[SEG] & RELATED ( 'SEGMENT'[SEGMENT_C] )

    • admin11's avatar
      admin11
      Icon for Memorable Member rankMemorable Member

      bcdobbs Ashish_Mathur 

       

      I try your propose expression :-

      SEGMENT_M_ = 'SALES'[SEG] & RELATED ( 'SEGMENT'[SEGMENT_C] )

      I get error msg below :-

      The column 'SEGMENT[SEGMENT_C]' either doesn't exist or doesn't have a relationship to any table available in the current context.

       

       

  • Hi,

    This should typically be a calculated column formula (not a measure) in the Sales table.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Click on the Data tab in the left hand side vertical panel, select the appropriate Table and then write the formula in that table.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi admin11 ,

     

    These two columns are from different tables, you will need to have a correspondence between them before you can merge them.

    Please show some sample data so that we could help.

     

    Best Regards,

    Jay