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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

how to create a custome coulumn in one table based on an unrelated table in the model

Hi,

 

I have the following model:

model.JPG

 

What I need to do is to create a custom column in BAR PROJECT_GROUP_PROJCT using POJECT_OWNER column, and relate it to dbo Sales Rep table using Rep ID - Name_c custom column. (there is no direct relationship between the 2 table as seen in the model).

The only thing in comon in values of each 2 column are the left 2 characters of the value (which basically is the Rep ID). 

the values of the two columns are as below:

project owner.JPGrepId_name.JPG

So I need the custom column that I create in PROJECT GROUP table to have the same values as column 
Rep ID - Name_c (which is a combination of Rep ID and Name of the Reps).

I cannot change the model. It ruins all my dashboard I guess.

 

I hope someone can help me.

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Anonymous,

Try this column.

Rep ID - Name_c = 
VAR _ProjectOwner = 'BAR PROJECT_GROUP_PROJCT'[PROJECT_OWNER]
RETURN 
CALCULATE(
    SELECTEDVALUE( 'Sales Rep table'[Rep ID - Name_c] ), 
    LEFT( 'Sales Rep table'[Rep ID - Name_c], 2 ) = _ProjectOwner
) 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Mariusz
Community Champion
Community Champion

Hi @Anonymous,

Try this column.

Rep ID - Name_c = 
VAR _ProjectOwner = 'BAR PROJECT_GROUP_PROJCT'[PROJECT_OWNER]
RETURN 
CALCULATE(
    SELECTEDVALUE( 'Sales Rep table'[Rep ID - Name_c] ), 
    LEFT( 'Sales Rep table'[Rep ID - Name_c], 2 ) = _ProjectOwner
) 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.