Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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
Solved! Go to 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]))
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
Hi,
This should typically be a calculated column formula (not a measure) in the Sales table.
Click on the Data tab in the left hand side vertical panel, select the appropriate Table and then write the formula in that table.
Now click on the New Column button appearing in the ribbon.
Share the download link of your PBI file and show the exact result that you want.
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 :-
Hi,
Try this calculated column formula
SEGMENT_M = 'SALES'[SEG] & LOOKUPVALUE(SEGMENT[SEGMENT_C],SEGMENT[SEG_RAW],SALES[SEG])
Hope this helps.
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?
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]))
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.
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] )
I try your propose expression :-
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.
| User | Count |
|---|---|
| 76 | |
| 36 | |
| 31 | |
| 29 | |
| 26 |