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
jostnachs
Helper III
Helper III

Concatenating columns from different tables

I have 3 tables. policy(fact table),agreement(dimension table) and structure(dimension table). now i would like to have a concatenated column in my agreement table with columns coming from policy table and structure table dependening on a condition that i have in agreement table. I am not sure how i can use concatenate/concatenatex/relatetable functions for this requirement.below is the relationship i have between these three tables.

 

jostnachs_0-1722874324732.png

Below is what I would like to acheive.

jostnachs_2-1722874491493.png

 

Regards,

Jostna 

 

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @jostnachs - as per above relationships shared, 

Policy table is related to the Agreement table so you can  bring the required column to agreeement table. using related 
Agreement table is related to the Structure table.--> bring the strucutred colum nto agreement table.

 

create a new column in agreement table as below:

ConcatenatedColumn =
VAR PolicyNumber = RELATED(Policy[PolicyNumber])
VAR StructureName = RELATED(Structure[StructureName])
VAR AgreementType = Agreement[AgreementType]

RETURN
IF(
AgreementType = "Active", // your condition add it
PolicyNumber & " |" & StructureName,
BLANK()
)

 

Hope it works





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

8 REPLIES 8
v-jialongy-msft
Community Support
Community Support

Hi @jostnachs 

Is your problem solved, and if so, please mark the corresponding reply as a solution, which will help users with the same problem to better solve their problem.

 

 

 

 

 


Best Regards,

Jayleny

rajendraongole1
Super User
Super User

Hi @jostnachs - as per above relationships shared, 

Policy table is related to the Agreement table so you can  bring the required column to agreeement table. using related 
Agreement table is related to the Structure table.--> bring the strucutred colum nto agreement table.

 

create a new column in agreement table as below:

ConcatenatedColumn =
VAR PolicyNumber = RELATED(Policy[PolicyNumber])
VAR StructureName = RELATED(Structure[StructureName])
VAR AgreementType = Agreement[AgreementType]

RETURN
IF(
AgreementType = "Active", // your condition add it
PolicyNumber & " |" & StructureName,
BLANK()
)

 

Hope it works





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 ,

 

Thank you so much for the help!

but i am having the following error.

jostnachs_0-1722883236890.png

 

i have all the fields and relation as mentioned above

tried it with the policy table alone but giving me the same relationship error.

its a m:n relation between policy and agreement, maybe there are records in the agreement-table without corresponding records in policy. you can try to make a table visual with the columns you want to have.

The RELATED function requires that a relationship exists between the current table and the table with related information. You specify the column that contains the data that you want, and the function follows an existing many-to-one relationship to fetch the value from the specified column in the related table. If a relationship does not exist, you must create a relationship.

Maybe a typo eg. is there really a space between Local Department?

its there 😀

i can say, that the solution with RELATED() works. (i have such a situation working). If you get an error message you have to check this message.

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.