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
Anonymous
Not applicable

Grouping rows of a column and splitting the related columns into new ones

Hi,

 

I tried for a while to solve this but can't work it out. A lot of the suggestions on here are similar but when I've followed solutions it never quite worked out and it's ended up duplicating my rows.

 

I have a table called Tickets which contains support ticket numbers. Each ticket number has an ID column. This column and table is linked to another one called Dynamic Fields Values. The link to the Ticket table is on a column called object_id and in this there are multiple duplicate entries linking to the tickets. For each object_ID there is a column called dynamic_field.name and a corresponding column called value_text. This mean that for example object_id 4700 could have a dynamic_field.name of 'Source' with the value_text 'Email' and then in another row for 4700 a dynamic_field.name of 'OverSLA' with the value_text 'Yes'.

 

What I want is one row for 4700 with a column for Source and a column for OverSLA. Is this possible? nothing I've tried has worked so far and when I try to do a join between Tickets and DynamicFields I end up with duplicate ticket numbers. Please help!

 

table.PNG

2 ACCEPTED SOLUTIONS

Hi @Anonymous 

 

Please see the attached file, all you need to do is Pivot dynamic_field.name column as below.
image.png

 

 

Best Regards,
Mariusz

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

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

Hi @Anonymous 

Only select this column "dynamic_field.name", then pivot column

Capture0.JPGCapture1.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Please can you provide a usable data sample, and if possible can you present an outcome that you desire?

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski


 

Anonymous
Not applicable

Hi,

 

This is the current table structure.

 

object_idvalue_textdynamic_field.name
4762PhoneSource
47622 mediumITSMCriticality
47623 lowITSMImpact
47623rd Party ReferralClosureActions
35934NoITSMReviewRequired
35934ComplexScreen
359340012000000xb1sCSalesID
35934PhoneSource

 

I need to separate out the dynamic_field.names into new columns and then the add the corresponding value_text for each grouped object_id. I need to do this so I have a one to one relationship between the object_id and another table with the ticket data.

 

object_idSourceITSMCriticalityITSMImpactClosureActionsITSMReviewRequiredScreenSalesID
4762Email2 medium3 low3rd Party Referral   
35934Phone   NoComplex0012000000xb1sC

 

As added background the Ticket table is the main one I'm reporting on so I would like to be able to create reports for the dynamic fields for each ticket. I can do this once I manage to get my table to look like the one above.

 

Make sense?

Hi @Anonymous 

 

Please see the attached file, all you need to do is Pivot dynamic_field.name column as below.
image.png

 

 

Best Regards,
Mariusz

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

Please feel free to connect with me.
Mariusz Repczynski

 

Anonymous
Not applicable

Hi,

 

That's great and solves one part but then I need to group by object_id. I tried that but end up with the below. When I expand count to show the rows it just ungroups the object_id again.

 

Capture.PNGCapture.PNG

 

Thanks,

 

Tom

 

 

Hi @Anonymous 

Only select this column "dynamic_field.name", then pivot column

Capture0.JPGCapture1.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous 

 

I've used Pivot Column in my solution, you don't need to use Group By or else, have I missed something?

 

Best Regards,
Mariusz

Please feel free to connect with me.
Mariusz Repczynski

 

 

 

 

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.