Forum Discussion
Error msg when i try to combine 2 column data into 1 column
Hi All
Today I try to create a expression :-
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
Community 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
Memorable Member
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.
- Ashish_Mathur
Super User
Hi,
This should typically be a calculated column formula (not a measure) in the Sales table.
- admin11
Memorable Member
- Ashish_Mathur
Super 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.
- AnonymousNot 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