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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
userpien
Helper I
Helper I

how to concatenate two columns from different tables many to many

Hi, I need to rewrite this query that comes from sql server in power bi. I think I have to use concatenatex but this function doesn't allow me to select the column of another 'table. How can I rewrite in power bi this query?

The two tables Aggregato and DER have a many to many relationship.

Query in SQL Server
Aggregato.Cod + ' ' + convert(char(10), CAST(DER.DTINO AS datetime), 103 ) + '-' + convert(char(10), CAST( DER.DTFIO AS datetime), 103 )

Thank you!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@userpien Either there is a blank value in the one side of the table or there is a duplicate row, you need to check that. The issue is that it needs to be one to many relationship as it is in SQL.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@userpien Either there is a blank value in the one side of the table or there is a duplicate row, you need to check that. The issue is that it needs to be one to many relationship as it is in SQL.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@userpien I see the issue there. What is your join condition in SQL? If it is many to many in SQL, it must be returning more rows than expected, no?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

on sql server the relation is many to one while on power bi it doesn't allow me to put this relation, but only many to many, and I don't know why ( it tells me that the many to one relation is not valid for this relation). How to correct this relation?

parry2k
Super User
Super User

@userpien it depends on the relationship between these two tables. could you provide the relationship details?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi, thanks for your help. The two tables Aggregato and DER have a many to many relationship with columns DTINO and DTFIO. All two set on "Both" for direction of cross filter.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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