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

PBI Custom Connector w OAuth2 grant_type client_credentials fails to refresh data

$
0
0

Hi,

We have built a Custom Connector using Power Query SDK the to be able to use a vendor system as a data source in Power BI.

We need this because the REST API from the system uses OAuth V2 with the Grant type “Client Credentials”

 

Here’s where our implementation differs from all the examples found online, where all OAuth examples use the Grant type “Authorization code”

 

Anyhow, the implementation works using Power BI Desktop locally,and also works online on powerbi.com (through a On-premise Data Gateway) on the first try and the following tries as long as the Access token has not expired.

 

But if you try to refresh either manually or by scheduler an hour after the initial setup, when the Access Token has expired, the online service doesn’t seem to understand that it has expired and requests a new one. Instead it gets an error when trying to connect to the datasource.

 

The error message under “Dataset” in powerbi.com reports the following:

Something went wrong
Invalid connection credentials.

Please try again later or contact support. If you contact support, please provide these details.
Underlying error code: -2147467259 Table: journal.
Underlying error message: The credentials provided cannot be used for the Vendorsystem source. (Source at Vendorsystem .)
DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259
Microsoft.Data.Mashup.CredentialError.DataSourceKind: Vendorsystem
Microsoft.Data.Mashup.CredentialError.DataSourcePath: Vendorsystem
Microsoft.Data.Mashup.CredentialError.Reason: CredentialInvalid
Microsoft.Data.Mashup.MashupSecurityException.DataSources: [{"kind":"Vendorsystem ","path":"Vendorsystem "}]
Microsoft.Data.Mashup.MashupSecurityException.Reason: CredentialInvalid
Cluster URI: WABI-EUROPE-NORTH-B-redirect.analysis.windows.net
Activity ID: 8bf0a164-83f9-4928-9e0c-f493249a6d7b
Request ID: 9960c0f8-540c-437d-87ba-7f7f28d1ef29
Time: 2019-06-16 22:18:09Z

If I at this point once again on powerbi.com go to Settings – Manage Gateways – Edit Credentials – Sign in and changes the name to enable the “Apply” button, it works for another hour.

 

My conclusion is that stated above, that the token acquired gets expired after an hour, but powerbi.com does not try to login again to get a new one.

Troubleshooting this in any deeper extent on my end is hard since most of the requests are made from the cloud service itself.

 

The Vendor System does not implement a "Refresh Token", which is an optional method in the SDK


Extract data from JSON URL

$
0
0

Hi,

 

I'm trying to extract the data from a JSON URL which has only one field like the following:
2019-06-18_15-05-14.png

The integer, in this case 1178, needs to be read from the Advanced Editor in Power BI. It's a variable that keeps changing as more tickets are created. This number needs to be stored and will get used later on in the query.

 

Is there a simple way to achieve this? So far, i've got to:

 	GetEntityCount = () =>
        let Url   = "http://url.freshdesk.com/helpdesk/tickets/summary.json?view_name=all",
            Json  = GetJson(Url),
            EnityCount = ([Json] ("view_count"))
        in  EntityCount

This obviously doesn't work, I've tried multiple things but I can't get it to work.

 

So to be short:
Extract 1 field from a JSON URL / REST API.

Store this field into a variable.

Done.

(Embedded) Slicer target does not match

$
0
0

Just wondering if anyone has hit anything like this before - using PBI embedded, and have a slicer to filter down to specific date ranges (text value, and column is text type).

 

The issue I'm having is I can't set this slicer, at all. Single value slicers work fine, another slicer I have that's multi-select with strings works fine but this one throws out "Filters target doesn't match slicer target."

 

I've attached the filter received from requesting getSlicerState:

getSlicerState.png

 

And here is an example of a filter I sent:

setSlicerState.png

 

 

Going further:

So I was wondering what would happen if I did absolutely nothing and just fed the result of getSlicerState into setSlicerState (without any modifications at all). It throws "slicerTargetDoesNotMatch" - so all evidence is pointing to this not being my issue so far. Sad.

 

 

Any ideas?

 

Converting rows to columns in SharePoint Online List Report

$
0
0

I have 2 SharePoint List.

Project (Project_ID, Project_Title) and Project_Tasks(Project_ID, Tasks_Title) [here Project_ID is lookup column from Project list.]

I have data as:

Project:

Project_IDProject_Title
P-1Project-1
P-2Project-2
P-3Project-3

Project_Tasks:

Project_IDTasks_Title
P-1Tasks-1
P-1Tasks-2
P-2Tasks-3
P-2Tasks-4
P-2Tasks-5

I am able to generate the following report.

Project_IDProject_TitleTasks
P-1Project-1Tasks-1
P-1Project-1Tasks-2
P-2Project-2Tasks-3
P-2Project-2Tasks-4
P-2Project-2Tasks-5

But My requirement is to generate a report like

Project_IDProject_TitleTasks
P-1Project-1
Tasks-1Tasks-2
P-2Project-2
Tasks-3Tasks-4Tasks-

In this case, the Pivoting will not help me. I have alreadty tried.

Please help. Any reference link, tutorial video or suggestion is most welcome

Console application using c# to read Power Bi Report

$
0
0

Hi,

 

I need to connect to power bI report using console apllication (c#) and assign the data to dataset and uplaod the data

into excel.Can anyone please help

 

Regards

Sri

Api to get current temprature

$
0
0

Hello,
I want to get the temprature (updated everyday) for my location.
I tried to do it with OpenWeatherMap but coudn't figure out exacly how to get data (what to put in url and where to put the key).
Does anyone have an idea or done it before ?
thank you

Error: "Uncaught SyntaxError: Unexpected token *"

$
0
0

Hi All,

 

I'm having some trouble in creating a custom visual.

 

I was developing a custom visual and was successful in doing so (Friday). But after accessing it again today and testing it, i got an error. 

 

I didn't even touch the code after I've got it to work.

 

 

This is the one that I've finished:
ezgif.com-video-to-gif (2).gif

 

 

This is the error I've got TODAY:
Capture.PNG

 

Any thoughts?

Connecting to Azure Storage Bolb - Custom Connector

$
0
0

I want to make a data custom connector which will connect to Azure Blob storage account bring in the data make some transformation on the data and provide to my client in a client understandable manner.
Can this be done ? If so how ? I am not able to find any examples doing the same.
Can I directly make use of AzureStorage.Blobs and proceed further ?


Facing issue in using JavaScript API

$
0
0

I am trying to use Power BI Javascript API in my R/Shiny application. Below is the .js file I am using:

 

Error : 

ERROR: shinyjs: Error parsing the JavaScript file: ReferenceError: window is not defined.

 

.js file:


// Read embed application token from textbox
var txtAccessToken = "H4sIAAAAAAAEAB2WxQ70CA6E3-W_ZqRAB0eaQ4eZ-RZm5qz23bdnr1b5UJ_tkv_zx0yefkryP3__AUnWXZGmg8RiXQ5kTnQIh8UOzSMI_-qJquuMKVkzNUtz7Xw2LIelle9bF7VhRyLhO5Aeoyax0ZtpXpC5jp2aVIgBhQOcJ4QUufkGTudZUOWiR14yRJDKnPbuozaKGI2gOff0EcIYs9AhQT06HuTHo39-JZesRYnMaHCr1Az99nQrVnJeoHukMsJrEOJtyIy9qxVpCH1ueCNde_kFKwDOPo4fn0CGYdxHN_3sdT2xMkXUSzE1HL_6QMmy-JjwYfs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IovP6wfmo0I_wJGNyRdl5awskCsy9_Xl9iUgK3OpVhwFXzzkcw8h0nwgF2rP7551_Mz1wXq-T_KDdhMHCblj6TVLasXMPyhTTX_1VOU43JfqzFTya9R6SXsQ7YEXtgR2gEyLicXtQviXyRgqSDLTcdsiqUL1rIv2RnNXpD7tRdaf-wjHgLoorQ8Q08B5IFZ0mHlLYKUrbOII-PGG87YXqlQqSCzQ4Z1Ha0Qe2tUClTmuXzPQN6Z9KS332gwwjT0vTcn2eXF7wLNrBSLvA45PYYb0H7t_d7cLjC-TDLDlpqnA56xLQedrmqib0NrLoFYsyJHXhjHtSXY_ZSc9Syu91ZRS3CCPqu-FE8Opsd63ebdK_AqObLOkwsfFfCEAd1yscDubCC2qWMT3F83sYd4f5VsLDKksuogG55W50T7jK9ZAzmtJIqgXTjwy3Wls9c7EN0XPpV_Iv5v_8DivcfMkILAAA="

// Read embed URL from textbox
var txtEmbedUrl = "https://app.powerbi.com/qnaEmbed?groupId=be8908da-da25-452e-b220-163f52476cdd"

// Read dataset Id from textbox
var txtDatasetId = "73d9b58d-c459-4aa2-acaa-e1ea1170aed3"

// Read question from textbox
var txtQuestion = "2014 total units YTD var % by month, manufacturer as clustered column chart"

// Read Qna mode
var qnaMode = "Show Q&A, use predefined question"

// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config= {
type: 'qna',
tokenType: models.TokenType.Embed,
accessToken: txtAccessToken,
embedUrl: txtEmbedUrl,
datasetIds: [txtDatasetId],
viewMode: models.QnaMode[qnaMode],
question: txtQuestion
};

// Get a reference to the embedded Q&A HTML element
var qnaContainer = $('#qnaContainer')[0];

// Embed the Q&A and display it within the div container.
powerbi.embed(qnaContainer, config);

 

Here is the source of the code : https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#

 

Kindly let me know if I can do anything differently.

 

Qualtrics API/Python Script

$
0
0

I've been trying for the longest to figure out how to import survey results from Qualtrics into Power BI using Python. Qualtrics support has given me code and I was told all I needed to do was change the apiToken, surveyId, fileFormat and dataCenter lines below but I have not been able to get this to work:


# Python 3

 

import requests

import json

import io, os

import sys

import pandas

from pandas.io.json import json_normalize

 

# Setting user Parameters

 

apiToken = '[ID]'

surveyId = "[ID]"

fileFormat = "csv"

dataCenter = ‘[Datacenter]’

 

# Setting static parameters

requestCheckProgress = 0.0

progressStatus = "inProgress"

baseUrl = "https://{0}.qualtrics.com/API/v3/surveys/{1}/export-responses/".format(dataCenter, surveyId)

headers = {

    "content-type": "application/json",

    "x-api-token": apiToken,

    }

 

# Step 1: Creating Data Export

downloadRequestUrl = baseUrl

downloadRequestPayload = {"format": fileFormat, "compress": False, "useLabels": True}

downloadRequestResponse = requests.request("POST", downloadRequestUrl, json=downloadRequestPayload, headers=headers)

progressId = downloadRequestResponse.json()["result"]["progressId"]

print(downloadRequestResponse.text)

 

# Step 2: Checking on Data Export Progress and waiting until export is ready

while progressStatus != "complete" and progressStatus != "failed":

    print ("progressStatus=", progressStatus)

    requestCheckUrl = baseUrl + progressId

    requestCheckResponse = requests.request("GET", requestCheckUrl, headers=headers)

    requestCheckProgress = requestCheckResponse.json()["result"]["percentComplete"]

    print("Download is " + str(requestCheckProgress) + " complete")

    progressStatus = requestCheckResponse.json()["result"]["status"]

 

#step 2.1: Check for error

if progressStatus is "failed":

    raise Exception("export failed")

 

fileId = requestCheckResponse.json()["result"]["fileId"]

 

# Step 3: Downloading file

requestDownloadUrl = baseUrl + fileId + '/file'

requestDownload = requests.request("GET", requestDownloadUrl, headers=headers, stream=True)

 

#data = json.loads(requestDownload.content)

#df = json_normalize(data['responses'])

data = requestDownload.content

df = pandas.read_csv(io.StringIO(data.decode("utf-8")))

df

 

I'm not a developer nor do I have Python experience, so I have no clue what I would need to change to get what I'm looking for. I'm slightly confused because this seems to be code for exporting results to a CSV, but I was hoping to connect straight from Power BI to Qualtrics. 

load and render report in mhtml

$
0
0

I would like to load and render a paginated report in mhtml/word.Then i email the report to subscribers after SSAs model refresh.

Best practice for accessing row data in dataView.table ?

$
0
0

Is there a way to access row data by column name? If not, is the index of the column always dependent on the order of the dataRoles array inside the capabilities.json?

R interactive map in Power BI using raster and shapefile

$
0
0

Hello!
I'm trying to load my script in power BI, which is:

-----------
library(ggplot2)
library(ggmap)
library(plotly)
library(raster)
library(sf)
library(rgdal)
library(rgeos)
library(mapview)


setwd("C:/Users/Daniel/Desktop/IDGeo/Earth analytics course_Learn data science/data/week 4")

ndwi <- raster("california/SJER/vector_data/2017_06_04_NDWI_CLIP.tif")

pivos <- readOGR(dsn = "california/SJER/vector_data",
"aneis_anapaula_0904")


M2<- mapView(ndwi, alpha.regions = 0.50, na.color = "transparent")
m4 <- mapview(pivos, lwd = 1.5, color = "gray40")

M2 + m4

 

-------------
ndwi = my raster data
pivos = my shapefile

----

In R it works perfectly and returns an interactive map containing my raster data plus myshapefile, however, in pwrbi nothing happen...

Anyone knows what could be happening?
Or, anyone could suggest another way to plot raster + shapefile interactive maps in power BI using R?
Thanks very much, best regards.

Dropdown list with Data name

$
0
0

Hi everyone,

 

For the needed of our organisation, I implement a combo chart with several types of chart, with as a base, this chart : PowerKPI

So I change GUID to package the new solution and everything was good. But I have a mistake on display the data name in the drop down list in the panel format.

 

Expect :

panel1.PNG                             

 

Result :

 panel2.PNG

 

I see the code in visual.ts where the settings applied but I don't find where the list was created.

 

I have already packaged the original source code but the result was the same.

 

Thanks for the help.

Improve Graphic Visualization of 15' auto-refreshing Dashboard

$
0
0

Hi

 

First i ask sorry if my english is bad ora i posted this in a wrong place.

 

i set up a dashboard showed on tvs into my company's office, to inform my colleagues of others desk about daily PnL trend.

I synchronized our SQL Server db to an Azure database and then connected to powerBI through direct query, so i'm able to pin dashboard tiles and auto update this dashboard visualizations while showing them in full screen.

 

All is working fine but the tile's auto formattation is quite ugly and i would like to show on screen better looking visuals, i tried pinning entire page and keep the layout i made on power bi desktop and refresh the page (for the autoupdate) with a chrome's extension that simulate F5 press but in this mode the page get off by fullscreen, so i'm forced to use tile to enable auto data refresh.

 

Is there a method  to improve tile's graphic ? or someone know others workaround that keep the 15' auto refresh?

 

Thank you all,

Angelo.


Creating Custom Visualization for PBI Report Server

$
0
0

Does anyone have experience with and can give suggestions on creating custom visualizations that work on Power BI Report Server? 

 

We have a user who developed a very simple custom visualization using Microsoft's instructions, and it works in the cloud service, but not on the Report Servers. What do we need to do differently to make it work on the report servers? 

 

Appreciate any help you can give. 

Pbi embbed , know which report consume which memory on plan

$
0
0

Hi,

 

We have around 100 reports hosted on our Power Bi Embbed on Azure. 

 

I would like to know which reports consume which ressources on our power bi embbed plan.

 

How can i achieve that ? 

 

I can't find any split per reports/datasets on azure for this power bi embed statistics.

 

90% of our reports are direct query.

 

Thanks,

 

 

Power KPI Visuals - Dropdown list with Data name

$
0
0

Hi everyone,

 

For the needed of our organisation, I implement a combo chart with several types of chart, with as a base, this chart : PowerKPI

So I change GUID to package the new solution and everything was good. But I have a mistake on display the data name in the drop down list in the panel format.

 

Expect :

panel1.PNG                             

 

Result :

 panel2.PNG

 

I see the code in visual.ts where the settings applied but I don't find where the list was created.

 

I have already packaged the original source code but the result was the same.

 

Thanks for the help.

Power BI Service APIs

$
0
0

Hi All, 

 

Just having a look at Power BI service APIs available at: https://docs.microsoft.com/en-us/rest/api/power-bi/

 

I was thinking about setting up a Power BI report to consolidate information about users, groups, permissions etc into a single report - do I have to 'register an app' to be able to use Power BI service apis within Power BI? If so, does anyone have a brief tutorial about using Power BI apis within Power BI itself?

 

Thanks, 

 

pbix

 

 

Pivot Table like the QlikSense Pivot Table

$
0
0

Hi everybody i'm new here and i have a question about the posibility to switch the columns and the rows in a pivot for a end user???

 

In QlikSense there is an option like that

 

if someone could help me with this, it would be great!

Viewing all 17968 articles
Browse latest View live


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