Forum Discussion
Error msg when i try to combine 2 column data into 1 column
- 4 years ago
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]))
Share the download link of your PBI file and show the exact result that you want.
- Ashish_Mathur4 years ago
Super User
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])) - admin114 years ago
Memorable Member
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 .
My PBI file :-
- Ashish_Mathur4 years ago
Super User
Hi,
Try this calculated column formula
SEGMENT_M = 'SALES'[SEG] & LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG])Hope this helps.
- admin114 years ago
Memorable Member
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
- Ashish_Mathur4 years ago
Super User
Hi,
Share the download link of the PBI file. Where is the source column - in which table?
- admin114 years ago
Memorable Member
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
- admin114 years ago
Memorable Member
Happy new year to you , Thank you very much , you code make my table look nice.
- Ashish_Mathur4 years ago
Super User
To you as well. Glad to hear that my solution is working.