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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.