cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dom33 Frequent Visitor
Frequent Visitor

language M substring ? in data query

Hi,

In my json input file I have a very large column (data_found in my request) and it is very long to load data in PowerBI.

I just want an extract of this large columns (the first 100 characters for example).

In the advanced editor, is it possible to add M language instructions to do that ?

 

Thanks

 

Dominique

 

let
    Source = Json.Document(File.Contents("C:\carto\results.json")),
    phone = Source[phone_number],
    columns = phone[columns],
    #"Converted to Table" = Table.FromList(columns, Splitter.SplitByNothing(), 1, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"location", "numbers_of_rows_analyzed", "percentage_of_personnal_data", "data_found"}, {"location", "numbers_of_rows_analyzed", "percentage_of_personnal_data", "data_found"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"data_found", type text}})
in
    #"Changed Type"

1 ACCEPTED SOLUTION

Accepted Solutions
MarcelBeug Super Contributor
Super Contributor

Re: language M substring ? in data query

No need for the Advanced Editor.

 

Select your column - on the "Transform" tab: Extract - First Characters - 100 - OK.

Specializing in Power Query Formula Language (M)

View solution in original post

2 REPLIES 2
MarcelBeug Super Contributor
Super Contributor

Re: language M substring ? in data query

No need for the Advanced Editor.

 

Select your column - on the "Transform" tab: Extract - First Characters - 100 - OK.

Specializing in Power Query Formula Language (M)

View solution in original post

v-ljerr-msft Super Contributor
Super Contributor

Re: language M substring ? in data query

Hi @Dom33,

 

Have you tried the solution provided by @MarcelBeug above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 113 members 1,548 guests
Please welcome our newest community members: