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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
sdertien
New Member

Expanding a column with both List and Record entries

I have a series of JSON documents that I'm querying over where at a particular level the resulting data is either a list or a record.  In the case where the data is shown as a List the JSON is typically a block of nodes like this:

 

 

      "Nodes": {
        "Node": [
          {
             "OS": {
              "_name": "Windows Server 2012 R2",
              "_vendor": "Unknown",
              "_version": "6.3",
              "_arch": "Unknown"
            },
            "_id": "HOST1",
            "_cpu": "amd64"
          },
          {
            "OS": {
              "_name": "Unknown",
              "_vendor": "Unknown",
              "_version": "Unknown",
              "_arch": "Unknown"
            },
            "_id": "HOST2",
            "_cpu": "Unknown"
          }
        ]
      }

In the case where it's listed as a Record it's a single record of the same data as follows:

      "Nodes": {
        "Node": {
          "OS": {
            "_name": "Windows Server 2008 R2",
            "_vendor": "Unknown",
            "_version": "6.1",
            "_arch": "Unknown"
          },
          "_id": "HOST1",
          "_cpu": "amd64"
        }
      }

Being extremely new to working this in Power BI I'm assuming that since I'm out of options in the Desktop UI that I likely need to parse this down using M code.  I'm assuming I can test if the type of entry is a List or a Record and IF/Else the results but I can't seem to figure out the right sequence.  I've seen a few other examples but haven't been able to get those to work and get a result.  Any pointers?  Thanks!

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.