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
JC79
Regular Visitor

Duplicate Values after 2x Split Column and Unpivot

Hello Everyone, I am struggling to achieve the desired output listed below. I have data coming from SharePoint with multiple values in a single cell separated by a comma. I was able to sucessfully split the columns and unpivot them, but now I have a huge mess of duplications. Does anyone know how I can obtain the desired output from raw data example below?

 

JC79_0-1676912998569.png

 

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @JC79 ,

Please have a try.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Lca7DYAwDEXRVZBrF37xN3vQRSkzAewvAqK594xBQBMgehS/DKSlfkyIhBHTua77wIZV7pYXLMVV+Seicfe9EnWjOR8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SO #" = _t, CUSTOMER = _t, total = _t, CMR = _t]),
    Custom1 = Table.FromColumns(List.Transform(Table.ToColumns(Source),each Text.Split(_{0},",")),Table.ColumnNames(Source))
in
    Custom1

vpollymsft_0-1677031213220.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @JC79 ,

Please have a try.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Lca7DYAwDEXRVZBrF37xN3vQRSkzAewvAqK594xBQBMgehS/DKSlfkyIhBHTua77wIZV7pYXLMVV+Seicfe9EnWjOR8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SO #" = _t, CUSTOMER = _t, total = _t, CMR = _t]),
    Custom1 = Table.FromColumns(List.Transform(Table.ToColumns(Source),each Text.Split(_{0},",")),Table.ColumnNames(Source))
in
    Custom1

vpollymsft_0-1677031213220.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.