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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
lachlanP
Helper II
Helper II

Selecting a component of a record based on another column

I have a column, "JSON" where each field is a record, and another column "ref1" which holds a reference to the JSON record. In this example it's just the text "accel" (one of the elements in the json record), but in practice each row would be different.

lachlanP_0-1654890875811.png

I am trying to create a new column which pulls out the "accel" value from the json array. This is what Ive tried:

lachlanP_1-1654890957032.png

But the problem is, it is looking for the value "A", not the value the variable holds, which is [ref1] or "accel".

lachlanP_2-1654891016807.png

 

Is there a way to use the square brackets selector to pick an element in the record, but use some sort of syntax to insert the actual value of my variable in? Something like:

A = [ref1]

element = [JSON][[A]] or

element = [JSON][#"A"]

 

where it references the value of the variable A, not the string "A".

 

Thank you!

1 ACCEPTED SOLUTION
lachlanP
Helper II
Helper II

I figured out a solution. Instead of referencing using:

element = [JSON][A]

I used:

Record.Field([JSON],[A])

 

This worked!

View solution in original post

1 REPLY 1
lachlanP
Helper II
Helper II

I figured out a solution. Instead of referencing using:

element = [JSON][A]

I used:

Record.Field([JSON],[A])

 

This worked!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors