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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

split into rows

My query connected to a .txt file, which has the following line:

 

 

elections_to_vest_changes = {'119WEST BUFFALO': '119000210WEST BUFFALO', '119UNION': '119000200UNION', '119NEW BERLIN': '119000190NEW BERLIN'}

 

The single quotation marks enclose text.  The colon is a delimiter for a column.  The comma is a delimiter for a row.

 

(I've shortened this line for readability.)  How can I split this line by delimiter into rows?  Thanks.

1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi,

if something like this is what you need

serpiva64_0-1649797493370.png

you have first to split by delimiter in rows

serpiva64_1-1649797538831.png

then split by delimiter in columns

serpiva64_2-1649797573328.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

 

Save your text in a json file, transforming '(single quote) into "(double quote) and use the following script to transform it into a table with two columns and many rows

 

 

let
    Source = Json.Document(File.Contents("C:\Users\sprmn\OneDrive\Documents\Power BI Desktop\test.json")),
    tfc=Table.FromColumns({Record.FieldNames(Source{0}),Record.FieldValues(Source{0})})
in
    tfc

 

 

serpiva64
Solution Sage
Solution Sage

Hi,

if something like this is what you need

serpiva64_0-1649797493370.png

you have first to split by delimiter in rows

serpiva64_1-1649797538831.png

then split by delimiter in columns

serpiva64_2-1649797573328.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.