Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
admin11
Memorable Member
Memorable Member

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.
 
admin11_0-1640648963848.png

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

 

1 ACCEPTED SOLUTION

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]))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

18 REPLIES 18
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

Ashish_Mathur
Super User
Super User

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

 

I cannot find calculated forumla :-

admin11_1-1640653388626.png

Hope you can share with me .

 

Paul

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

I have try still get error . Do you mean below :-

admin11_0-1640658010694.png

 

Now click on the New Column button appearing in the ribbon.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

I try to create the column , i still get error. See below image :-

admin11_1-1640659295295.png

 

Share the download link of your PBI file and show the exact result that you want.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

I know the answer is to combine SEGMENT_C field from SALES Table and SEG field from SEGMENT Table, But i don't know how to write to code .

admin11_0-1640660507913.png

My PBI file :-

https://www.dropbox.com/s/4ufqp99gpnp9ek5/PBS_VER0252%20Ask%20how%20to%20combine%20SEG%20field.pbix?...

Hi,

Try this calculated column formula

SEGMENT_M = 'SALES'[SEG] & LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Thank you very much for your expression , it work fine. for

SOURCE = LE , SD , PW ,PM, DA

But for SOURCE = TS , TA, TP , TI it display as "A02Business Partner" instead of "Business Partner"

 

Can you help me to add one more condition to below expression , that is only perform LOOKUPVALUE for SOURCE = LE , SD , PW ,PM, DA

 

SEGMENT_M = 'SALES'[SEG] & LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG])

 

Wish you happy new year

 

Paul

Hi,

Share the download link of the PBI file.  Where is the source column - in which table?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Appreciate very much for your help. i encloed below link is the PBI sample file , with detail explanation in the page.

 

https://www.dropbox.com/s/wh91oq9alv9c5p2/PBS_VER0275.pbix?dl=0

 

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]))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Happy new year to you , Thank you very much , you code make my table look nice.

To you as well.  Glad to hear that my solution is working.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
bcdobbs
Community Champion
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] )



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@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.

 

admin11_0-1640653196726.png

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.