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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
brandanb
Regular Visitor

Problems when importing CSV file

I have a CSV file that I've imported and set "comma" as the delimiter. However, the way the CSV was formatted, I'm running into issues. Below, table 1, is what Power BI & Excel automatically transform the CSV into. Table 2 is what I need the data to look like. How do I transform this?

 

1.)

UsernameValidSerialNumbers
johndoeXYZ1234, ABC1234, DEF1234
alicedoeWEB1234, FRE1234, BVY1234

 

2.)

UsernameValidSerialNumbers
johndoeXYZ1234
johndoeABC1234
johndoeDEF1234
alicedoeWEB1234
alicedoeFRE1234
alicedoeBVY1234
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@brandanb , In data transformation/edit query you have an option to split column. Split column into rows. use that

check steps

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @brandanb ,

 

Would you please refer to the M query:

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WysrPyEvJT1XSUYqIjDI0MjbRUXB0coYwXFzdQAylWJ1opcSczORUiMJwVyeIvFuQK4ThFBYJURgLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Username = _t, ValidSerialNumbers = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Username", type text}, {"ValidSerialNumbers", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "ValidSerialNumbers", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"ValidSerialNumbers.1", "ValidSerialNumbers.2", "ValidSerialNumbers.3"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"ValidSerialNumbers.1", type text}, {"ValidSerialNumbers.2", type text}, {"ValidSerialNumbers.3", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {"Username"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"})
in
    #"Removed Columns"

 

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@brandanb , In data transformation/edit query you have an option to split column. Split column into rows. use that

check steps

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.