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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
michaelbarratt
Regular Visitor

Merge columns? Pivot data?, not 100% sure what to ask for to be honest.

Hi,

I'm not really sure what exactly to ask for with this query, so i'll try and explain as best as possible the situation and intended outcome.

I have a table (Tickets to Custom Attributes) that links to another table (Tickets) using a column labelled "ticket_id".

This table contains 2 entries for every ticket_id with a custom attribute assigned (bgs_location and report method)

I need to be able to create a Column for each on the Tickets table with those 2 custom attribute values. Right now i can't merge query because the 2 different types of attributes are both contained in the same table.

So basically on the Tickets table, i want a column labelled "BGS Location" and the value of it pulling from the "Tickets to Custom Attributes" table and another column labelled "Report Method" with the value pulled from the "Tickets to Custom Attributes" table.

 

Tickets to Custom AttributesTickets to Custom AttributesTicketsTickets

I know i need to do something with the "Tickets to Custom Attributes" table to seperate them by custom_attribute_id somehow but im not sure what.

I'm really sorry if this doesn't make any sense at all, it's really hard to explain without having a clue where to even start.

Ideally i would have a column already on the "Tickets" table for the custom_attribute_id so i could merge the columns and expand for the value, but because there are 2 different "custom_attribute_id" for each ticket, i have no idea where to start.

 

Thanks

 

Mike

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

Hello there @michaelbarratt ! Maybe one the following links may help you with your question:

 

https://community.powerbi.com/t5/Power-Query/Conditional-Merge/td-p/841271

https://www.excelguru.ca/blog/2014/09/03/multi-condition-logic-in-power-query/

https://www.ehansalytics.com/blog/2020/9/8/conditional-merge-in-power-query

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

View solution in original post

2 REPLIES 2
goncalogeraldes
Super User
Super User

Hello there @michaelbarratt ! Maybe one the following links may help you with your question:

 

https://community.powerbi.com/t5/Power-Query/Conditional-Merge/td-p/841271

https://www.excelguru.ca/blog/2014/09/03/multi-condition-logic-in-power-query/

https://www.ehansalytics.com/blog/2020/9/8/conditional-merge-in-power-query

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

Genius! Thank you very much!

The last link really made it click in my head. All sorted now.

 

Thanks

 

Mike

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.