Quantcast
Channel: Developer topics
Viewing all 17928 articles
Browse latest View live

Report Import REST API 500 Error

$
0
0

Trying to upload .pbix files through the

 

`/v1.0/myorg/groups/{groupId}/imports`

 

API endpoint, and getting a 500 error returned.

 

status: 500,
statusText: 'Internal Server Error',
headers: {
'content-length': '0',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-frame-options': 'deny',
'x-content-type-options': 'nosniff',
'access-control-expose-headers': 'RequestId',
'request-redirected': 'true',

 

Here's the code snippet I'm using to make the request:

 

 

 

 

static async uploadReportToGroup(groupId: string, reportName: string, filePath: string): Promise<AxiosResponse | undefined>{ const accessToken = await PowerBIController.getAccessToken(); if(accessToken === '') { return new Promise<undefined>((resolve: any, reject: any) => resolve(null)); } const requestURL = (process.env.MS_API_URL as string) + 'groups/' + groupId + '/imports?datasetDisplayName=' + reportName + '&nameConflict=Overwrite'; const options = { headers: { Authorization: 'Bearer ' + accessToken, 'Content-Type': 'multipart/form-data', 'Content-Length': fs.statSync(filePath).size }, httpAgent: new http.Agent({ keepAlive: true }), httpsAgent: new https.Agent({ keepAlive: true }) }; const formData: FormData = new FormData(); formData.append('file', fs.createReadStream(filePath), { contentType: 'application/octet-stream' }); return axios.post(requestURL, formData, options); }

 

 

 

 

 

 

You can assume that the AccessToken I'm retrieving is valid, as it works with other endpoints.


Update report content using rest api returns Unauthorized

$
0
0

I'm trying to create a functioning CI/CD setup. Using UpdateReportContent I want to update the Production report with the Test report.

I'm calling the REST API using the Service Principal and it all works fine for other stuff, i.e. getting reports, uploading pbix files.

The SP has admin rights to both Test and Production workspace. The Service Principal also have the correct permissions (Report.ReadWrite.All) registered in the App Registration in Azure AD.

I've tried this using Postman and by calling the REST API with Powershell, both with the same 401 Unauthorized result. 

 

However when I use the "playground / try it" here signing in with my own personal account (which also have admin rights) i can update the report. The request body I used is the same as the one from postman, therefore verifying that my json body is correct.

 

Anyone who have been able to update the report using the REST api with Service Principal ?

 

Response: 

{"error":{

"code":"PowerBINotAuthorizedException",

"pbi.error":{

"code":"PowerBINotAuthorizedException",

"parameters":{},

"details":[],

"exceptionCulprit":1

}}}

Couldn't retrieve the data for this visual Embedded RLS

$
0
0

 

Hi, I'm trying to use Row Level Security in a simpla report for test purpose, the dataset is setted in import mode and i upload it directly. I'm the owner of the dataset. I'm able to show the data filtered in power bi desktop throw the functionality "View As Roles" and evrythings works!

 

When i try to embed the report whitout apply the RLS i correctly view the report.

But when i try to apply the RLS I have, for eatch visual, the error:

 

Couldn't load the data for this visual
Couldn't retrieve the data for this visual. Please try again later.
Please try again later or contact support. If you contact support, please provide these details.
Activity ID: d1e48dd3-f34b-4e91-8a83-1a87c842b952
Request ID: 6892d38c-16de-573d-2af4-434a2b7a9f18
Correlation ID: 5e07a676-c5b7-8cb1-4911-1487be66cd68
Time: Tue Dec 03 2019 15:32:15 GMT+0100 (Ora standard dell’Europa centrale)
Service version: 13.0.11499.187
Client version: 1911.3.022
Cluster URI: https://WABI-NORTH-EUROPE-redirect.analysis.windows.net

 

 

This is the json that i use to request the Generate Token for embedded:
{
  "accessLevel": "View",
     "identities": [
      {
          "username": "francesco@fakemail.net",
          "roles": [
          "roleA"
      ],
      "datasets": [
          "dd7a44c8-1763-4615-a934-f581b1d4738d"
      ]
}
]
}

 

 

Thanks for your attention!

 

Reguards

Marco

Get an Azure AD access token for embedding reports using JavaScript

$
0
0

Hi all,

I'm using the Javascript SDK of power bi in order to embbed reports on my Wrodpress website.

 

I went for the "user own data" approch as i want to use RLS .

My desiref flow is:

- user visit my site

- user being asked to log-in with his power bi account

- after use is logged in to power bi he can see the embedded report on my website.

 

I am stuck with the stage of signing in the user and getting the access token.

i was reffered to this example:

https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token

 

but it is being done with C#, I'm a front end developer and dont have .net environment on my server.

Does anybody have a sample or can tell me how can i do the same sample with JavaScript?,

How can i sign in the user and get an access token with JS, not C#?

 

Thank you all!

 

Export to PowerPoint (Power BI Embedded)

$
0
0

Is there an option to Export to a PowerPoint from an Embeded Visual?  

Import Mode Power BI Embedded

$
0
0

Hi!

Recently our company has acquired the embedded version of Power BI, but we have not planed nor have budget to buy the azure sql DW to use live connection. We will refresh the data only one time or less per month, so we don't need a live data.

My question is, can I import a data model from our SQL Server local DB into a pbix and upload to power bi service to use this file (or files) as our power bi embedded file? 

 

Thank you for your kindness to respond this post.

Powerapps embedded in Power BI Report for PDF Conversion

$
0
0

Hi there!

 

Current Situation:

I have several powerapps screens embedded in my Power BI Report. I want to programmatically export to PDF with a good format in A4. 

 

Problem:

I've tried using the Export function on Power BI Service but my Powerapps embeds either come blank or with overly large text.

 

What I tried:

So, I thought I'd do it programmatically. There doesn't seem to be a straight forward solution. I did come across an API that was going to be released in Feb 2020 for export to pdf, ppt and more from Power BI Embedded. 

 

What I'm looking for in a solution (if available):

But, I am looking for a solution now where I can print my Power Bi (with the embedded powerapps boxes) straight to PDf without the issues/problems I have now.

 

Any help and/or advice would be much appreciated.

 

Cheers,

 

Grabbing Reports in Groups

$
0
0

I am currently building an MVC application using the Power BI C# SDK that is supposed to embed multiple reports into one page using the app owns data model. However, the method client.Reports.GetReports() is only returning the first report in the workspace, whereas I want it to return all the reports in the workspace.

 

Is this possible? And if so, what is the mistake?

 

 

 


Connect Rest API with user authentication and line limit per request

$
0
0

Hi

 

I´m trying to connect to the next API using Blank Query but it’s been more complex that I thought

 

On the next lines the API info:  

 

Method: GET Path: https://api.repsly.com/v3/export/clients/{lastTimestamp}

Accept: application/json, application/xml

Content-Type: application/json, application/xml

User: 804144F2-78E3-47DE-9CCB-9B226634CD91

Password: 3B5A34D3-AD6D-496E-9125-4CAD9F8FXXXX

In each call the Api sends 50 lines - data base is no less than 600 lines.

 

To get the first set of data I change the {lastTimestamp} for a 0 as the next example https://api.repsly.com/v3/export/clients/0 

 

On the next lines a short description on how I the Metadata must be implemented:

 

"In every response you will receive meta variable LastTimeStamp of the last changed record in the list. Save it for future requests so you can use it as a parameter {lastTimeStamp} for every subsequent request until the response meta variable TotalCount is equal to 0, which means you have received all updates.   To get the complete list of clients, start your request with parameter {lastTimeStamp} = 0.  

 

Any help will be more than apreciated!!!

Power BI Publish from Blob Storage Not Working

$
0
0

I am trying to publish a Power BI report using Power BI REST APIS but i get a RequestedFileIsEncryptedOrCorrupted error.
Documentation for the Power BI request can be found at https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup.

Here are the steps I am following

1. Create a temperary Blob Location

Request

```
POST /v1.0/myorg/groups/{groupId}/imports/createTemporaryUploadLocation HTTP/1.1
Host: api.powerbi.com
Authorization: Bearer {token}
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Host: api.powerbi.com
Accept-Encoding: gzip, deflate
Content-Length: 0
Connection: keep-alive
cache-control: no-cache
```

which returns the following data

```
{
"@odata.context": "",
"url": "",
"expirationTime": ""
}
```

2. Push file to temp blob location

then using the url I send the following request

```
PUT {url from step 1} HTTP/1.1
Host: wabieus2bppbiv2.blob.core.windows.net
x-ms-blob-type: BlockBlob
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Host: wabieus2bppbiv2.blob.core.windows.net
Content-Type: multipart/form-data;
Accept-Encoding: gzip, deflate
Content-Length: 2057012
Connection: keep-alive
cache-control: no-cache


Content-Disposition: form-data; name="file"; filename="{local pbix file path here}
```
This request responds with a 201 created

Then I send the publish report call

```
POST /v1.0/myorg/groups/{groupId}/imports?datasetDisplayName={name}&amp; nameConflict=CreateOrOverwrite&amp; skipReport=False HTTP/1.1
Host: api.powerbi.com
Content-Type: multipart/form-data;
cache-control: no-cache

Content-Disposition: form-data; name="fileUrl"

{url from step 1}
```

I get a 400 Bad Request Error with the folowing data
```
{
"error": {
"code": "RequestedFileIsEncryptedOrCorrupted",
"pbi.error": {
"code": "RequestedFileIsEncryptedOrCorrupted",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
}
```

Expected Behavior: Report published to Power BI Service
Actual Behavior: RequestedFileIsEncryptedOrCorrupted Error

Direct query or import for report

$
0
0
We have an on premise data warehouse which is updated once a day, should we use direct query or import ?
Import has much better performance but as I am new to power bi I am unsure which is best/recommended as both work

Thanks

Requesting the datasources using the Get Datasources REST API returns an unexpected response

$
0
0

Hi,

 

I have created a dataset (in this case an Excel table) in Power BI in 2 different ways:

  1. I loaded the Excel table into a Power BI Desktop model and published the report to the Power BI service.
  2. I imported the same Excel file in the Power BI service: Create Dataset → Files → Local file → Import.

Looking at the datasets on "My workspace", both show up:

 

2019-12-05_09h51_57.png

I'm using the Get Datasources REST API call to retrieve the datasources for both datasets, by providing the datatsetId as the URL parameter.

When retrieving the datasources for the dataset created within Power BI desktop, I get the following response: 

2019-12-05_09h58_38.png

However, when I do the same for the dataset created within Power BI service (which is the same datasource), I get a different response:

 

2019-12-05_10h03_13.png

When retrieving the datasource from this dataset I get: "value": [ ] instead of the datasource (Excel-file).

 

Does anyone know why I do not get the same response for borh requests?

 

Thanks in advance,

Marc

How to create a text column so to be used as a slicer

$
0
0

Hi,

Can anyone suggest me how to achieve the below scenario.

 

I have a data set (Direct Query) with individual Time periods as week,Quarter & year.

I need to create a text column (Period) as below and use the column as a drop down filter.How to create it?

Period
Weekly
Quarterly
Yearly

when selected Weekly on Period filter it should point to week column and when selected Quarterly it should point to Quarter column. etc...

and how do my visuals axis get changed accordingly.

 

I hope my question is clear.

 

Regards,

DD

 

 

 

Q&A linguistic SchemaDocumentation, and possibilites

$
0
0

Hi Power BI community, 

 

I am currently impelmenting a Q&A solution for some ad-hoc reporting. 


So I understand all the UI things that can be done to build some ontology between the columns and the business unterstanding, i.e. renaming columns, using synonyms or defining adjectives with the Teach Q&A feature. 

So my understanding is that with the linguistic schema we can define phrasings. For example "what have my customers bought". So we would define the verb [buy,purchase] and set the Subject as customertable.customer and the Object as producttable.product. 

At the moment the documentation on this topic is really sparse. For example to me it is not clear what Operators are valid for Conditions for example. In the doc I could only find "Equals", but how do we write ">", "<", or "<>" in the schema? 

The only useful documentation that I could find is here: 
https://powerbi.microsoft.com/en-us/blog/editing-q-a-linguistic-schemas/

https://docs.microsoft.com/de-de/power-bi/natural-language/q-and-a-tooling-advanced

Does anyone have other sources? For me this is not really enough, and only offers information for the presented cases. I think Microsoft should really provide better documentation on this topic. I am also not sure if lingusitic schemas that are now developed, will still be working in the future once the feature goes into public availability.

Greetings, 

Chris

Power BI Visual calling into REST APIs

$
0
0

I am developing a sample power bi visual after following the article - https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial

 

I am trying to use the 'request' npm package on the 'visuals.ts' on the constructor and then call into a custom API like the sample code shown below:

 

 console.log('error:', error); // Print the error if one occurred
 console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
 console.log('body:', body); // Print the HTML for the Google homepage.
 });
 
I encounter an error on the 'pbiviz start' phase while trying the above. 
 
Hence trying to check if this is allowed and how I could go about looking up the build error

iOS Embedded Power BI instances still using double tap

Scraping data from this website - Community Forum

$
0
0

Hello,
Sometimes I would like to research my own posts to find an answer that is similar to a new question.  Would you be able to give me the steps to be able to scrape all the data from below. I also looked at the RSS feed which maybe contains more data? I would like to do it in one operation as well, rather than going over all pages one by one.  And if this could be extended to my private messages as well, it would be helpful. 
Thoughts?

Thank you,

Nathaniel

 

 

 scrape.PNG

Power BI template App does not support On-premises data source.

$
0
0

We have a Power BI report, in which our data source is on-premises SQL server database, and we have around 30+ tables, and there are joins between few tables in the model. We want to create a Power BI App template to distribute our dashboard.

But template app says “It does not support on-premises data source”.

 

Can anybody please suggest what is the best workaround in this case?

Ayuda por favor consulta sql a dax

$
0
0

Agradezco su colaboración guiandome como seria la siguiente consulta SQL en DAX, lo que necesita es el promedio de la diferencia de tiempo de un campo entre un registro y otro.

 

SELECT A.sede_sede, A.vehi_placa , A.sede_fechahora actual ,
(select top 1 b.sede_fechahora
from [DWSIGAB].[dbo].[FacTopeSeguimiento] B
where A.vehi_placa = B.vehi_placa and B.sede_fechahora > A.sede_fechahora
order by B.sede_fechahora) siguiente, DATEDIFF(ss, A.sede_fechahora, (select top 1 b.sede_fechahora
from [DWSIGAB].[dbo].[FacTopeSeguimiento] B
where A.vehi_placa = B.vehi_placa and B.sede_fechahora > A.sede_fechahora
order by B.sede_fechahora)) diferencia
INTO #TEMPFacTopeSeguimiento
FROM [DWSIGAB].[dbo].[FacTopeSeguimiento] A
order by A.vehi_placa, A.sede_fechahora ASC

 

SELECT vehi_placa, AVG(diferencia) promedio
FROM #TEMPFacTopeSeguimiento
group by vehi_placa
order by 2 desc

Connecting to Graph API through Odata feed - permission issues with some queries

$
0
0

Hi all.

 

I have been trying to connect to the Microsoft graph API through an OData feed in Power BI. I understand that the OData support in this API is patchy with different commans and types of filters being supported on different endpoints, however, this seems to work for simple queries. 

My problem is that for some operaions that I know the API supports it gives me the error: "Expression.Error: Access to the resource is forbidden."

The present instance of this problem is with the groups endpoint (https://graph.microsoft.com/v1.0/groups). I can query the endpoint raw perfectly fine. However, I need to expand the members field for each group, and when I attempt to do this the above error occurs. I know I have sufficient permissions for this as I have successfully run this query through the graph explorer (Query: https://graph.microsoft.com/v1.0/groups?$expand=members). 

 

I can successfully expand other fields in the groups dataset in PowerBI, it is just members that causes this issue (as far as I have found).

 

Does anyone know or have an idea of why this doesn't work from within PowerBI? 

 

Thanks

Ryan

Viewing all 17928 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>