Forum Discussion
Creating "variable" for input query
- Anonymous6 years ago
Hi samw5 ,
Please create query parameter to change the data source dynamically instead of using slicer selection, you can refer the following documentations to achieve it.
Change the Source of Power BI Datasets Dynamically Using Power Query Parameters
Dynamic Web.Contents() and Power BI Refresh Errors
Web.Contents with dynamic file URL
Best Regards
Rena
samw5 , not clear, refer if this can help
https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/
- samw56 years ago
Helper II
So i have data from 2 tables being fetched from Azure.
I created a 3rd table with Name and ID columns.
What I'm trying to do, is to setup a slicer on my visualization that will allow me to pick the "Name", then use the "ID" as a variable into my 2 other tables.- Greg_Deckler6 years ago
Community Champion
samw5 - So, you should just have to use this in your measure:
VAR __ID = MAX('Third Table'[ID])
Since you select a name, that will filter that third table to that name so the MAX will get the associated ID.
- samw56 years ago
Helper II
OK now while the filter would work, how could I possibly (not sure if that can even be done) use that ID value back into the original 2 tables queries?
That VAR_ID would need to somehow be inserted into my query. Not sure how to do that.
= let Source = Json.Document(Web.Contents("https://api.loganalytics.io/v1/workspaces/VAR_ID/query"