Forum Discussion

Rookie_2022's avatar
Rookie_2022
Frequent Visitor
1 year ago
Solved

Power Query - Table in Column

Hi all,   I would executed an API query for each row of a table. Each row has its API result which gives a table (multiple rows x multiple columns). May I know how to expand this "locations" into r...
  • v-kpoloju-msft's avatar
    1 year ago

    Hi Rookie_2022,

    Thank you for reaching out to the Microsoft fabric community forum. I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it.

    M Query:

    let
    
        // Simulating API response per row (each row has a nested table in [locations])
    
        Source = Table.FromRecords({
    
            [OriginCountry="KH", OriginCity="Sihanoukville", DestCountry="NL", DestCity="Rotterdam",
    
                locations = #table({"Departure","Arrival","Carrier"},
    
                            {
    
                                {#datetime(2025,9,5,8,0,0), #datetime(2025,9,15,10,0,0), "MAEU"},
    
                                {#datetime(2025,9,6,8,0,0), #datetime(2025,9,16,10,0,0), "MAEU"}
    
                            })
    
            ],
    
            [OriginCountry="US", OriginCity="New York", DestCountry="GB", DestCity="London",
    
                locations = #table({"Departure","Arrival","Carrier"},
    
                            {
    
                                {#datetime(2025,9,7,8,0,0), #datetime(2025,9,17,10,0,0), "MSC"},
    
                                {#datetime(2025,9,8,8,0,0), #datetime(2025,9,18,10,0,0), "MSC"},
    
                                {#datetime(2025,9,9,8,0,0), #datetime(2025,9,19,10,0,0), "MSC"}
    
                            })
    
            ]
    
        })
    
    in
    
        Source

    Select the locations column. Click the expand button (two arrows ⇔ at the column header). Choose which fields you want (Departure, Arrival, Carrier). Uncheck Use original column name as prefix (optional). Press OK.

     

     


    I am also including .pbix file for your better understanding, please have a look into it:

    Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

    Thank you for using the Microsoft Fabric Community Forum.