Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone, I have two queries A and B, query A is my main data source and query B is a json file that I use for both power BI and a python application we use here.
I would like to know how I can import just one field from my query B and convert it to a parameter to filter the data from my query A.
I can do this with a parameter manually changing the value when necessary, but I would like to do this through my json file, because that way would update other reports that use the same parameter.
Solved! Go to Solution.
I put it together in one query, but I think it demostrates the idea:
let
B =
let
Source = "{""a"":1}",
Use = Json.Document("{""name"":""John"", ""age"":30, ""car"":null}")[age]
in Use,
A =
let
t = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQitWJVjKCUMYQygRIxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Ages = _t]),
#"Filtered Rows" = Table.SelectRows(t, each (Number.From([Ages]) = B))
in #"Filtered Rows"
in A
Above query B returns a number (age) from the JSON string and then query A refers to query B (essentially, uses the number it returns) to use as a filter.
Cheers,
John
@Greg_Deckler I did as indicated, but my parameter is empty.
I would like that single item in the list to become the value of my parameter.
Is it possible to do this?
I put it together in one query, but I think it demostrates the idea:
let
B =
let
Source = "{""a"":1}",
Use = Json.Document("{""name"":""John"", ""age"":30, ""car"":null}")[age]
in Use,
A =
let
t = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQitWJVjKCUMYQygRIxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Ages = _t]),
#"Filtered Rows" = Table.SelectRows(t, each (Number.From([Ages]) = B))
in #"Filtered Rows"
in A
Above query B returns a number (age) from the JSON string and then query A refers to query B (essentially, uses the number it returns) to use as a filter.
Cheers,
John
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
6 | |
6 | |
5 |
User | Count |
---|---|
9 | |
9 | |
8 | |
6 | |
6 |