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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
mdufresne34
Frequent Visitor

Extract values from Json

Hello,

 

I am trying to retrieve data from an API that sends back this type of JSON : 

{
    "dataframes": [
        {
            "data": {
                "Timestamp": [
                    "2024-12-31T23:00:00.000+00:00",
                    "2025-01-31T23:00:00.000+00:00",
                    "2025-02-28T23:00:00.000+00:00"
                ],
                "signal1": [
                    6679,
                    3348,
                    469
                ],
                "signal2": [
                    0,
                    0,
                    0
                ]
            }
        },
        {
            "data": {
                "Timestamp": [
                    "2025-03-31T22:00:00.000+00:00",
                    "2025-04-30T22:00:00.000+00:00",
                    "2025-05-31T22:00:00.000+00:00",
                    "2025-06-30T22:00:00.000+00:00",
                    "2025-07-31T22:00:00.000+00:00",
                    "2025-08-31T22:00:00.000+00:00",
                    "2025-09-30T22:00:00.000+00:00"
                ],
                "signal1": [
                    3936,
                    2392,
                    1939,
                    3016,
                    2151,
                    2698,
                    5454
                ],
                "signal2": [
                    0,
                    0,
                    0,
                    0,
                    36,
                    60,
                    82
                ]
            }
        }
    ]
}

The issue is that in power query I am not able to retrieve each signals corresponding to each timestamp. Everytime, i expand the column timestamps and unpivot the columns, i have every signals for 1 timestamp : 
After expanding the timestamps, unpivoting the columns and before expanding the values : 

mdufresne34_0-1764168023937.png

After expanding the values : 

mdufresne34_1-1764168090509.png

I'd like to have 1 line/timestamp/signals, how can I expand everything at the same time so I have the right values in front of the right timestamp ? 

 

Thank you in advance, 
MD

1 ACCEPTED SOLUTION

@mdufresne34 , Got it. After reaching the at list level. I used List.Zip and then again done few operations. You can paste the below code in advance editor of an empty query. Also attaching file after signature

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("xVNNC8IwDP0r0qtW0qTtVn+Ht3WHgh8ITsR5k/13qzsMdRm0KJYdsry8vLelqSpx86dZPF5swjXsLqHZtl6sZlWffpzbEA6Vj5o3oAfXh9jhGprzW5fXKgTUUqEktUZaAcRnCQDzZ+TFYoJnJKhMHkosR3mftHqklRftYX8KRzXxadYWjnFBpEsG0talWcAJC8CIsPkR6ddUN7x2i59fjDgoeg4YkwesJUEOz2Tq2Uy9IlOvzOQ5zuf3Lj45sowLJIcMpByx6wKKbaiM4iDruCUz2ug/bllinv2blmOUmLTIfRgLOlHXdw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Parsed JSON" = Table.TransformColumns(#"Changed Type",{},Json.Document),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Parsed JSON", "Column1", {"dataframes"}, {"Column1.dataframes"}),
    #"Expanded Column1.dataframes" = Table.ExpandListColumn(#"Expanded Column1", "Column1.dataframes"),
    #"Expanded Column1.dataframes1" = Table.ExpandRecordColumn(#"Expanded Column1.dataframes", "Column1.dataframes", {"data"}, {"Column1.dataframes.data"}),
    #"Expanded Column1.dataframes.data" = Table.ExpandRecordColumn(#"Expanded Column1.dataframes1", "Column1.dataframes.data", {"Timestamp", "signal1", "signal2"}, {"Column1.dataframes.data.Timestamp", "Column1.dataframes.data.signal1", "Column1.dataframes.data.signal2"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Column1.dataframes.data", "Custom", each List.Zip({[Column1.dataframes.data.Timestamp],[Column1.dataframes.data.signal1],[Column1.dataframes.data.signal2]})),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Extracted Values" = Table.TransformColumns(#"Expanded Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Custom", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Custom.1", "Custom.2", "Custom.3"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type datetime}, {"Custom.2", Int64.Type}, {"Custom.3", Int64.Type}})
in
    #"Changed Type1"
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

6 REPLIES 6
v-tejrama
Community Support
Community Support

Hi @mdufresne34 ,

 

Thank you @amitchandak for the helpful input!


Were you able to resolve the issue? If the response addressed your query, kindly confirm. This helps keep the community informed and improves solution visibility.


Thank you for your support!

Hi @mdufresne34 ,

I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

Thank you.

amitchandak
Super User
Super User

@mdufresne34 , Please check have already tried to use it as json column 

amitchandak_0-1764170222642.png

and expand one by one 

amitchandak_1-1764170259769.png

 

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
amitchandak
Super User
Super User

@mdufresne34 , Please check have already tried to use it as json column 

amitchandak_0-1764170222642.png

and expand one by one 

amitchandak_1-1764170259769.png

 

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

Hello, This is what i do, but the issue is when i expand the columns, how can I have the right data in front of the right timestamp ?

@mdufresne34 , Got it. After reaching the at list level. I used List.Zip and then again done few operations. You can paste the below code in advance editor of an empty query. Also attaching file after signature

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("xVNNC8IwDP0r0qtW0qTtVn+Ht3WHgh8ITsR5k/13qzsMdRm0KJYdsry8vLelqSpx86dZPF5swjXsLqHZtl6sZlWffpzbEA6Vj5o3oAfXh9jhGprzW5fXKgTUUqEktUZaAcRnCQDzZ+TFYoJnJKhMHkosR3mftHqklRftYX8KRzXxadYWjnFBpEsG0talWcAJC8CIsPkR6ddUN7x2i59fjDgoeg4YkwesJUEOz2Tq2Uy9IlOvzOQ5zuf3Lj45sowLJIcMpByx6wKKbaiM4iDruCUz2ug/bllinv2blmOUmLTIfRgLOlHXdw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Parsed JSON" = Table.TransformColumns(#"Changed Type",{},Json.Document),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Parsed JSON", "Column1", {"dataframes"}, {"Column1.dataframes"}),
    #"Expanded Column1.dataframes" = Table.ExpandListColumn(#"Expanded Column1", "Column1.dataframes"),
    #"Expanded Column1.dataframes1" = Table.ExpandRecordColumn(#"Expanded Column1.dataframes", "Column1.dataframes", {"data"}, {"Column1.dataframes.data"}),
    #"Expanded Column1.dataframes.data" = Table.ExpandRecordColumn(#"Expanded Column1.dataframes1", "Column1.dataframes.data", {"Timestamp", "signal1", "signal2"}, {"Column1.dataframes.data.Timestamp", "Column1.dataframes.data.signal1", "Column1.dataframes.data.signal2"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Column1.dataframes.data", "Custom", each List.Zip({[Column1.dataframes.data.Timestamp],[Column1.dataframes.data.signal1],[Column1.dataframes.data.signal2]})),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Extracted Values" = Table.TransformColumns(#"Expanded Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Custom", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Custom.1", "Custom.2", "Custom.3"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type datetime}, {"Custom.2", Int64.Type}, {"Custom.3", Int64.Type}})
in
    #"Changed Type1"
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.