api
3 TopicsPower BI: How to generate a table of daily web traffic reports? Help?
I pull data from a digital site via an API into Power BI for reporting. The API has an analytics endpoint for a web traffic report, but it is ONLY an aggregate report, as in it won't make one call and separate it into individual days. I can call (below) to show the traffic for any particular day. I would like to write a query to use this API call to generate a table where each row is the traffic for a day starting at 2022-05-15 until whatever the current day is. So a row for 05-15, 05-16, 05-18, until the current date. Anyone have a suggestion? https://api.somewhere.tv/analytics?type=traffic&from=2022-05-15&to=2022-05-15Solved855Views0likes2CommentsSyntax Issues with API Call
Can anyone identify what is wrong with this function? I know a "Token Comma Expected" however, I cannot figure out to fix this problem. The bolded/underlined phrases below are whats giving me this problem: Source = Csv.Document(Web.Contents("https://ClinicalTrials.gov/api/query/study_fields?&fields=NCTId,LeadSponsorName,Phase,BriefTitle,Org...max_rnk=" & Number.ToText( limit )"&fmt=csv&min_rnk=" & Number.ToText( offset )),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),Solved594Views0likes1CommentCall Power BI API in Power Query
I'm trying to retrieve data from Power BI API services and the same is being accomplished via PowerShell code. But unfortunately due to some circumstances I am not able to deploy it in production. Hence now I am trying to get the same thing done in Power BI desktop itself so that I can call power BI rest API from Power Query only. There are tons of blogpost about calling an API in power query but they all require Power BI App registered Client ID. Which I don't have. I'm successfully able to call with my user name password in PowerShell and even I'm getting response from API. Please find below PowerShell code and let me know if we can replicate the same in Power Query. # User credential $User = 'shahab***@*****.com' $Pword = ConvertTo-SecureString –String '***password***' –AsPlainText -Force $Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User,$Pword # Connect to service Login-PowerBIServiceAccount -Credential $Credential #Get Bearer token $headers = Get-PowerBIAccessToken $uri = 'https://api.powerbi.com/v1.0/myorg/datasets/f52f2abc-6445-41ee-ce02-3908c6e18dd4/refreshes' $refreshes = Invoke-RestMethod -Uri $uri -Headers $headers -Method GET $xs= $refreshes819Views0likes1Comment