Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am new to Power BI. Is it possible to wildcard what is in red below? This will change depending on the parameters in the web request.
Source = Json.Document(Web.Contents(APIURL & "/timeseries/" & Encoded & "?includeData=true&aggregationType=" & Aggregation & "&startTimestamp=" & StartTimeEPOCH & "&endTimestamp=" & EndTimeEPOCH & "&predict=false&tag=easytravel&Api-Token=" & APIToken)), dataResult = Source[dataResult], dataPoints = dataResult[dataPoints], #"APPLICATION-4462DAA0020F7410" = dataPoints[#"APPLICATION-4462DAA0020F7410"], #"Converted to Table" = Table.FromList(#"APPLICATION-4462DAA0020F7410", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Thanks.
Solved! Go to Solution.
Hi @DynaNate,
it seems as if you are trying to select one specific column for the table that has been returned in step "dataPoints".
If you cannot use the name of the column, you have to use a different identifier. That could be the position of the column for example.
Table.Column(dataPoints, Table.ColumnNames(dataPoints){0})
would return the first column from that table (as Power Query is zero based indexed)
Or do you have a different logic after which to select the relevant column?
With regards to the stepname, you can just replace it with a dummy like so:
Source = Json.Document(Web.Contents(APIURL & "/timeseries/" & Encoded & "?includeData=true&aggregationType=" & Aggregation & "&startTimestamp=" & StartTimeEPOCH & "&endTimestamp=" & EndTimeEPOCH & "&predict=false&tag=easytravel&Api-Token=" & APIToken)), dataResult = Source[dataResult], dataPoints = dataResult[dataPoints], DummyStepName = dataPoints[#"APPLICATION-4462DAA0020F7410"], #"Converted to Table" = Table.FromList(DummyStepName, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @DynaNate,
it seems as if you are trying to select one specific column for the table that has been returned in step "dataPoints".
If you cannot use the name of the column, you have to use a different identifier. That could be the position of the column for example.
Table.Column(dataPoints, Table.ColumnNames(dataPoints){0})
would return the first column from that table (as Power Query is zero based indexed)
Or do you have a different logic after which to select the relevant column?
With regards to the stepname, you can just replace it with a dummy like so:
Source = Json.Document(Web.Contents(APIURL & "/timeseries/" & Encoded & "?includeData=true&aggregationType=" & Aggregation & "&startTimestamp=" & StartTimeEPOCH & "&endTimestamp=" & EndTimeEPOCH & "&predict=false&tag=easytravel&Api-Token=" & APIToken)), dataResult = Source[dataResult], dataPoints = dataResult[dataPoints], DummyStepName = dataPoints[#"APPLICATION-4462DAA0020F7410"], #"Converted to Table" = Table.FromList(DummyStepName, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
HI @DynaNate,
You can try to use query formula, I add parameter step and rename functions to convert wildcard fields name to specify one so you can simple extract value from it.
let Source = Json.Document(Web.Contents(APIURL & "/timeseries/" & Encoded & "?includeData=true&aggregationType=" & Aggregation & "&startTimestamp=" & StartTimeEPOCH & "&endTimestamp=" & EndTimeEPOCH & "&predict=false&tag=easytravel&Api-Token=" & APIToken)), dataResult = Source[dataResult], dataPoints = dataResult[dataPoints], fieldName = "APPLICATION-4462DAA0020F7410",//cache field name #"Rename" = Table.RenameColumns(dataPoints,{{fieldName, "APPLICATION"}}) #"Extract Field" = #"Rename"[APPLICATION], #"Converted to Table" = Table.FromList(#"Extract Field", Splitter.SplitByNothing(), null, null, ExtraValues.Error) in #"Converted to Table"
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |