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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
GorujamBI
Regular Visitor

Transformation data

I got data from Web using API, i want to know how to transform the lines in columns and more important! merge the keys...

Like "Name":"Valour" ... i have many Names ... the Names have to be in the Coluns ans Valour following below

 

Invoice, NF-e, Start, Approval comercial, Approove comercial, Approval financeiro, Approove financeira, Brought, Price, Seller, UF, Tipe, Register... these names have to become Coluns and values following bellow

 

 

[
{
"Invoice": "072046",
"NF-e": null,
"Start": "2024-08-22",
"Approval comercial": "FRANCISCO",
"Approove comercial": "2024-08-22 09:37:59",
"Approval financeiro": "ALINE",
"Approove financeira": "2024-08-22 10:25:08",
"Brought": null,
"Price": 1137.34,
"Seller": "39 IGOR MARTINS CARVALHO",
"UF": "SP",
"Tipe": "12",
"Register": "2020-04-09"
},
{
"Invoice": "072047",
"NF-e": null,
"Start": "2024-08-22",
"Approval comercial": "FRANCISCO",
"Approval financeiro": "2024-08-22 10:12:14",
"Approval financeiro": "ALINE",
"Approove financeira": "2024-08-22 10:26:23",
"Brought": null,
"Price": 4664.69,
"Seller": "39 IGOR MARTINS CARVALHO",
"UF": "RS",
"Tipe": "12",
"Register": "2022-04-04"
}

]

 

1 ACCEPTED SOLUTION
NaveenGandhi
Super User
Super User

Hi @GorujamBI 

Below m code will work. Just replace the source step according to your source.

let
    Source = Json.Document(
    "[{
            ""Invoice"": ""072046"",
            ""NF-e"": null,
            ""Start"": ""2024-08-22"",
            ""Approval_comercial"": ""FRANCISCO"",
            ""Approove_comercial"": ""2024-08-22 09:37:59"",
            ""Approval_financeiro"": ""ALINE"",
            ""Approove_financeira"": ""2024-08-22 10:25:08"",
            ""Brought"": null,
            ""Price"": 1137.34,
            ""Seller"": ""39 IGOR MARTINS CARVALHO"",
            ""UF"": ""SP"",
            ""Tipe"": ""12"",
            ""Register"": ""2020-04-09""
        },
        {
            ""Invoice"": ""072047"",
            ""NF-e"": null,
            ""Start"": ""2024-08-22"",
            ""Approval_comercial"": ""FRANCISCO"",
            ""Approove_comercial"": null,
            ""Approval_financeiro"": ""ALINE"",
            ""Approove_financeira"": ""2024-08-22 10:26:23"",
            ""Brought"": null,
            ""Price"": 4664.69,
            ""Seller"": ""39 IGOR MARTINS CARVALHO"",
            ""UF"": ""RS"",
            ""Tipe"": ""12"",
            ""Register"": ""2022-04-04""
        }]"
    ),

    TableData = Table.FromList(Source, Record.FieldValues, {"Invoice", "NF-e", "Start", "Approval_comercial", "Approove_comercial", "Approval_financeiro", "Approove_financeira", "Brought", "Price", "Seller", "UF", "Tipe", "Register"})
in
    TableData

 Let me know if this helps.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

View solution in original post

1 REPLY 1
NaveenGandhi
Super User
Super User

Hi @GorujamBI 

Below m code will work. Just replace the source step according to your source.

let
    Source = Json.Document(
    "[{
            ""Invoice"": ""072046"",
            ""NF-e"": null,
            ""Start"": ""2024-08-22"",
            ""Approval_comercial"": ""FRANCISCO"",
            ""Approove_comercial"": ""2024-08-22 09:37:59"",
            ""Approval_financeiro"": ""ALINE"",
            ""Approove_financeira"": ""2024-08-22 10:25:08"",
            ""Brought"": null,
            ""Price"": 1137.34,
            ""Seller"": ""39 IGOR MARTINS CARVALHO"",
            ""UF"": ""SP"",
            ""Tipe"": ""12"",
            ""Register"": ""2020-04-09""
        },
        {
            ""Invoice"": ""072047"",
            ""NF-e"": null,
            ""Start"": ""2024-08-22"",
            ""Approval_comercial"": ""FRANCISCO"",
            ""Approove_comercial"": null,
            ""Approval_financeiro"": ""ALINE"",
            ""Approove_financeira"": ""2024-08-22 10:26:23"",
            ""Brought"": null,
            ""Price"": 4664.69,
            ""Seller"": ""39 IGOR MARTINS CARVALHO"",
            ""UF"": ""RS"",
            ""Tipe"": ""12"",
            ""Register"": ""2022-04-04""
        }]"
    ),

    TableData = Table.FromList(Source, Record.FieldValues, {"Invoice", "NF-e", "Start", "Approval_comercial", "Approove_comercial", "Approval_financeiro", "Approove_financeira", "Brought", "Price", "Seller", "UF", "Tipe", "Register"})
in
    TableData

 Let me know if this helps.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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