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

Using Containers when having more than one object in Capabilities

$
0
0

Hi everyone,

 

Currently trying to build a custom visual where I have multiple sections for the formatting options.

In each section I want to have one or more containers where I should apply certain formatting per measure or attribute.

 

Does anyone have a example on how to achieve this?

 

Thank you

 

Regards,

LS


Update Datasource Credentials With OAuth2 using PowerBI Rest API on C#

$
0
0

Hello, 

I need to update a Datasource credential, inside a Workspace on Powerbi, inside a C# Project.

I'm using the PowerBI Rest API to do it, but when I try to update the Datasource Credentials, I get an error.

Error Body:
"... HTTP/1.1 400 Bad Request
{"error":{"code":"BadRequest","message":"Bad Request","details":[{"message":"The property 'oauthcredentials' does not exist on type 'Microsoft.PowerBI.ServiceContracts.Api.GatewayDatasource'. Make sure to only use property names that are defined by the type.","target":"datasourceDelta"}]}}"

 

My code :

var AccessToken = userAuthnResult.AccessToken;
string
 restUrlPatchCredentials = PowerBiServiceRootUrl + "gateways/" + gatewayToUpdate.gatewayId + "/" + "datasources/" + gatewayToUpdate.id;PBIDataSourceCredentials dataSourceCredentials = new PBIDataSourceCredentials {    credentialType = "OAuth2",    oauthcredentials = new PBICredentialData    {        accessToken = AccessToken    } };
string jsonDelta = JsonConvert.SerializeObject(dataSourceCredentials);

// add JSON to HttpContent object and configure content typeHttpContent patchRequestBody = new StringContent(jsonDelta); patchRequestBody.Headers.ContentType = new MediaTypeWithQualityHeaderValue("application/json");var method = new HttpMethod("PATCH");var request = new HttpRequestMessage(method, restUrlPatchCredentials); request.Content = patchRequestBody;HttpClient client = new HttpClient(); clien.DefaultRequestHeaders.Add("Accept""application/json"); clien.DefaultRequestHeaders.Add("Authorization""Bearer " + AccessToken);var result = client.SendAsync(request).Result;

I think the error is the name of the "oauthcredentials" propriety, but i can't find the correct name.
Anyone having the same issue?

 

Thanks you!

Never Confirm Navigation?

$
0
0

we have a custom visual popup with a link , but it asks users to confirm navigation to another site. Is there a way to disable the prompt/confirmation?

 

pbi confirm.png

User able to Edit the Power BI Report in Javascript SDK with Embed Token Genereated for View only

$
0
0

I have embedded the power bi report using service principal as given here.

I'm generating the embed token as below,

var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel:"View",allowSaveAs:false,identities: new EffectiveIdentity[] { new EffectiveIdentity(username: serviceAccount, roles: new string[] { "Viewer" }, datasets: new string[] { report.DatasetId }) });
EmbedToken embedToken = client.Reports.GenerateTokenInGroup(groupId, reportId, generateTokenRequestParameters);

But when I embed the report using javascript sdk, if I configure the permission as below the user able to edit the reports. How can prevent the user from editing the report in the embed token?

permissions: models.Permissions.ReadWrite,
viewMode: models.ViewMode.Edit,

 

[Power BI AP] POST Dataset relationship generates blank on filter

$
0
0

I have a dataset schema that looks like this 

 

{  
   "name":"sample",
   "defaultMode":"Push",
   "tables":[  
      {  
         "name":"Table1",
         "columns":[  
            {  
               "name":"date",
               "dataType":"DateTime"
            },
            {  
               "name":"Hour",
               "dataType":"DateTime"
            },
            {  
               "name":"Zone",
               "dataType":"string"
            },
            {  
               "name":"Type",
               "dataType":"string"
            },
            {  
               "name":"Price",
               "dataType":"Int64"
            }
         ]
      },
      {  
         "name":"zone",
         "columns":[  
            {  
               "name":"zone",
               "dataType":"string"
            }
         ]
      }
   ],
   "relationships":[  
      {  
         "name":"123",
         "fromTable":"zone",
         "fromColumn":"zone",
         "toTable":"table1",
         "toColumn":"Zone",
         "crossFilteringBehavior":"OneDirection"
      }
   ]
}

When I post the dataset, and fill it with rows, containing only two zones each. I get a blank in the filter viz. I don't have any idea where this blank comes from. Do you have any idea where this might come from ?

 

Capture.PNG

Documentation about adding paid license KEY technique for Custom Visual

$
0
0

Hi all,

 

I want to start developing paid Custom Visuals. I searched through the documentation (https://powerbi.microsoft.com/nl-nl/developers/custom-visualization/) but I couldn't find any explanation about how to implement the monetizing feature (adding license key) as described in this article: https://powerbi.microsoft.com/en-us/blog/new-monetization-option-for-power-bi-custom-visuals-through-appsource/.

Can someone provide me with technical documentation on how to setup this? For example I want to distinguish the price of the Visual between Viewers and Creators.

 

Thanks for advance for your help.

 

greetings,

 

Waldemar

Workspace ID not found

$
0
0

I am trying to embed a Power BI Report to a Web App. I am using the Sample Web App provided in the Github and the sample report. I am following the steps mentioned in the link https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-your-organization#embed-your-co...

 

However, I am still getting an error on running the application when I try accessing with an account where the report is in the shared with me section.

 

 

pantallazo.png

 

 

Workspace with id: 'me' not found. Please validate the provided workspace ID.

 

To do that I am using this Workspace ID: (me)

https://app.powerbi.com/groups/me/reports/737479d4-8f2b-45a7-ab78-ef090fc8cdbd/ReportSection

 

If I access with the account where is the original workspace there is no problem but if the report has been shared with other account I can't access to the report with that account and it displays the error.

This is the Workspace ID that works with the original account where the report is: (ba1f7b15-efdc-41c6-9b5e-a73be97461ef)

https://app.powerbi.com/groups/ba1f7b15-efdc-41c6-9b5e-a73be97461ef/reports/737479d4-8f2b-45a7-ab78-ef090fc8cdbd/ReportSection

 

A temporary solution I found was add as a member the account  which has the report shared into the workspace and it works, but if the person log in into the power bi account the person can see all the reports in that workspace.

 

I appreciate your help.

 

 

 

Workspace ID not found

$
0
0

I am trying to embed a Power BI Report to a Web App. I am using the Sample Web App provided in the Github and the sample report. I am following the steps mentioned in the link https://docs.microsoft.com/en-us/power-bi/developer/embed-sample-for-your-organization#embed-your-co...

 

However, I am still getting an error on running the application when I try accessing with an account where the report is in the shared with me section.

 

 

pantallazo.png

 

Workspace with id: 'me' not found. Please validate the provided workspace ID.

 

To do that I am using this Workspace ID: (me)

https://app.powerbi.com/groups/me/reports/737479d4-8f2b-45a7-ab78-ef090fc8cdbd/ReportSection

 

If I access with the account where is the original workspace there is no problem but if the report has been shared with other account I can't access to the report with that account and it displays the error.

This is the Workspace ID that works with the original account where the report is: (ba1f7b15-efdc-41c6-9b5e-a73be97461ef)

https://app.powerbi.com/groups/ba1f7b15-efdc-41c6-9b5e-a73be97461ef/reports/737479d4-8f2b-45a7-ab78-ef090fc8cdbd/ReportSection

 

A temporary solution I found was add as a member the account  which has the report shared into the workspace and it works, but if the person log in into the power bi account the person can see all the reports in that workspace.

 

I appreciate your help.

 


Problem using visual.getFilters()

$
0
0

Hello,

 

I'm having an issue where I can set a visual embedded but I am unable to get the filters that are on the visual. (as shown in the image)

error.png

 

Optimizing Performance for my Local Measure

$
0
0

Below you will see my bread crumb trail of measures that make up my main measure *_Monthly At Risk Units in which I am trying to help with the duration of the load time. It currently takes 11 seconds and I am trying to understand how I can improve it. 

 

The colors explained - Yellow is my main measure. Pink is the measure referenced in the yellow measure. Gray measures are the ones used in the pink, and olive green within the gray. Let me know if you have any ideas on a DAX formatting change or a different way I could do this. 

 

 

*_Monthly At Risk Units = var RiskUntis = [*_Availability by Month]

Return

IF([*_Availability by Month]<0,[*_Availability by Month])

 

*_Availability by Month = ATP[*_Rolling Total ATP] - [*_Rolling Total At Once Master]

 

*_Rolling Total ATP =

CALCULATE([*_ATP (TA)],                      

    FILTER(

        ALL(

            'Common Days TA'),

            'Common Days TA'[YearMonth] <= MAX('Common Days TA'[YearMonth])))

 

*_Rolling Total At Once Master =

SUMX (

    FILTER (

        ALLSELECTED ( 'Common Days TA'[YearMonth] ),

        'Common Days TA'[YearMonth] <= MAX ( 'Common Days TA'[YearMonth] )

    ),

    [*_At Once Master (TA)]

)

 

*_ATP (TA) =

CALCULATE(

    [*_ATP Units],

    TREATAS(VALUES('Common Days TA'[DateKey]), 'Event Date'[DateKey])

)

 

*_At Once Master (TA) = CALCULATE([*_At Once Master],

TREATAS(VALUES('Common Days TA'[DateKey]), 'Event Date'[DateKey]))

 

Unable to scale an Azure node

$
0
0

I am attempting to use the Zero-Downtime-Capacity-Scale.ps1 script from the Power BI Powershell Samples repository, as described here. I have downloaded the script, obtained the Client ID, logged in to AzureRM, etc. as described in the script. And I am an owner of the resource to be scaled.

 

I had to change the RedirectUri because the new interface for app registritaions has changed how Redirect Uris are specified, and I got past that error.

 

Now when I run the script as instructed, it reports ">>> Capacity rivip01 is available and ready for scaling!" and then starts Step1. 

 

It successfully creates the temporary capacity and asks for my login, which I provide. Then it throws an error:

 

Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At D:\RIVIP\BI-AdHoc\Refresh\ScaleNode\Zero-Downtime-Capacity-Scale_Opus.ps1:288 char:23
+ ... itiesList = Invoke-RestMethod -Method Get -Headers $auth_header -Uri  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
GetCapacityObjectID : Capacity rivip01 object ID was not found!
At D:\RIVIP\BI-AdHoc\Refresh\ScaleNode\Zero-Downtime-Capacity-Scale_Opus.ps1:289 char:31
+ ... eCapacityObjectId = GetCapacityObjectID $capacitiesList $CapacityName
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Smiley Happy  [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,GetCapacityObjectID

 

The statement causing the error is:

    $capacitiesList = Invoke-RestMethod -Method Get -Headers $auth_header -Uri $getCapacityUri

and $getCapacityUri looks correct: https://api.powerbi.com/v1.0/myorg/capacities

 

Can anyone show me how to run this script to scale the capacity? It does exactly what I need to accomplish, but I have not been able to get it to work yet.

 

Thanks,

 

Sam

Conditional display of report pages

$
0
0

Hello All,

 

Need help with displaying of Report pages in POWER BI. There are multiple customers for which we have to create different visualizations. I don't want to create different reports for different customers instead I want to create different pages for different customers in the same report. I should be able to select a customer and based on customer selection, respective report pages should be displayed. For example, there are 2 customers, A & B. For Customer A we have pages 1,2,3 and for Customer B we have pages 1,4,5 in the report Customers_Report. So when I select Customer A, only pages 1,3 & 5 should be selected and for Customer B, pages 1,4,5 should be displayed.

 

Please help me how to achieve this.

How to handle Time series data APIs wih OAuth2.0 authentication service

$
0
0

Hi,
We have timeseries data in API’s and want to utlize them in Power BI. But we are struggling with
authentication, as the APIs use Oauth2.0 Bearer tokens that expire on date. Can anyone please elaborate on how to handle the token services here.

I did a POC on Power Bi Embedding and that handeled the Access token/ Embedded token by generating a new one, each time the console is loaded. or we have something with SPN now which can work in this scenario??? Please advice. Thanks

Sorting Reimports Data and affects Refresh Speeds

$
0
0

I have two questions (I already tried to search for the answer but haven't found one):

- Why does sorting operation in Power Query reimports the entire data? This doesn't seem to happen in other operations. 

- The refresh (when we click "Close & Apply") is terribly slow after I implement sorting in the Power Query. 

 

Background:

I have imported data from 11 different text files (appending them - turns out about 1.2M rows in all and 23 columns) and after importing, one of the last operations before loading the data into PowerBI is to sort the data by two of the columns. When the operation is executed, I see the entire data being reimported which takes about a minute or two. I do not see any explanation when sorting is explained in tutorials. 

 

Also, since then, the refresh, which used to take just about 4-5 minutes earlier, is taking crazy times (never finished after waiting for about 25-30 minutes). 

Initially, I thought it might be a network issue, so I copied the files from network into my C drive and updated the path in the "Source" stage of the data import but no change. I also checked by importing the files from the network into another tool and it worked fine. 

 

After removing the sorting step, the refresh works fine. 

Too Many....values. Not Displaying all data. Filter the data or choose another field.

$
0
0

 

Hi,

 

In our organisation,  some Report(s) text search filters for some end-users are giving following error message "Too Many....values. Not Displaying all data. Filter the data or choose another field." . However, the BI Team is not experiencing this issue. We are not sure where the issue is coming from as it is effecting many Reports and we have not experienced this issue before.

 

Kindly advise.


Can Power BI process hierarchical data (Parent child and Account tables) without custom SQL scripts

$
0
0

Hi,

 

I am new to Power BI. I have two tables with one having Parent-Child relationship (hierarchy table) and another with the Account and it details. My question is, Can Power BI connect to the data source and use these tables and create a report with natural hierarchy format WITHOUT using custom queries. (i.e, they should only import the tables and use drag, drop, join features to create an hierarchy data)

 

Thanks

Armani

Store a Rest API in Power BI

$
0
0

Hello, 

 

I'm a debutant in power BI. I have an API that is completely independent from power bi and gives me new information every 10 minutes without storing it. I would like to use power bi to read and store the information (add new lines to each column every 10 min), in a database. I've succeeded in reading the information with power bi, but every 10 min I have new data and I loose the previous information I had. 

 

Can you help me building the databse that will store the information given every 10 min ? 

 

 

Help with looping with parameters on a table and joining similar tables

$
0
0

Hello,

 

I am hoping someone would be able to help me out or point me in the right direction. I am newer to PowerBI and have written a new connector which is working flawlessly. However, there has been a new requirement and I am struggling to find a way to create this solution in PowerBI.

 

Basically, I am connecting to an API and downloading tables of information. One of the tables includes a list of ORGINIZATIONAL GROUPS in the system. The issue is is there are effectively nested tables (but have to make indvidual API calls to get them). Here is my code so far....

 

DoceboBranches = (url as text) as table =>
    let
        orgchart = GetPage("https://<myapi>.com/manage/v1/orgchart"),
        withurl = Table.AddColumn(orgchart, "usersUrl", each "https://<myapi>.com/manage/v1/orgchart/"&[id]&"/users", type text),
        response = Table.AddColumn(withurl, "userTable", each Docebo.Feed([usersUrl]), type table)

    in
        response;

 

STEP 1 (orgchart and wirturl): Get the master ORGCHART table and build links, download each link/orgchart table (which includes all Users accociated with that org which is located in userTable).

 

The above code yields the folling table:

2019-05-01 10_54_44-Docebo - Microsoft Visual Studio.png

 

STEP 2: This is the part where I am struggling at to do programatically.

 

For each record/row; IF HASCHILDREN is EQUAL TO "True" then take the ID from the table, build a URL, and pass it into my GetPage funtion. I would also like to loop this as some of these are 3-4 layers deep. 

 

For example, because ID 8 hashchildren, I need to download another table: https://<myapi>.com/manage/v1/orgchart?node_id=8 which returns:2019-05-01 11_13_17-Docebo - Microsoft Visual Studio.png

Once this is returned, I would like to add the IDs to the usersUrl and download these user tables as well. However, I am not sure how to even access these rows as records and use these parameters as variables.

 

 

STEP 3: Basically (from step 1) I would like to end up with a master table that brings all the nested tables forward:

Example

idtitlehaschildrenusersUrluserTable
11DemoFALSEhttps://<myapi>.com/manage/v1/orgchart/11/users[Table]
8EmployeesTRUEhttps://<myapi>.com/manage/v1/orgchart/8/users[Table]
2Salesforce ContactsTRUEhttps://<myapi>.com/manage/v1/orgchart/2/users[Table]
13DISYSFALSEhttps://<myapi>.com/manage/v1/orgchart/13/users[Table]
10NetmetschekFALSEhttps://<myapi>.com/manage/v1/orgchart/10/users[Table]
14NetmetscheckFALSEhttps://<myapi>.com/manage/v1/orgchart/14/users[Table]
9TimeXpertsFALSEhttps://<myapi>.com/manage/v1/orgchart/9/users[Table]

.................and so on...

STEP 4: Once the above is done, I would like a table with ID and TITLE only (from step 3)

STEP 5: THEN take all the users out of the userTables and have one list including only User, User, ID then use the Step 4 table to match the OrgIDs to the name of the Org.

 

Is anyone able to help me out or point me in the right direction for STEP 2?

 

Thank You

PowerBI Embedded GetVisuals with Alternate text

$
0
0

Hi,

 

How do I get the Visual information when I know only the alternate text?

 

On a separate note, I am embedding my Power Bi Report in javascript  to get the page nos and the visuals. It would be great if that was added to the SDK as well  and I didn't have to resort to embedding the report.

 

Thanks, Shilpi

Changing gateway parameter isanchorgateway through powershell module?

$
0
0

Is there any possibility of adding a parameter to the Set-OnPremisesDataGateway module that can change the "Anchor Gateway" for that cluster?

Example:

 

Set-OnPremisesDataGateway -ClusterObjectId **example-clusterid** -GatewayObjectId **example-gatewayid** -MemberStatus Enabled -isAnchorGateway True

 

Granted, this might be an extremely rare use case but it would prevent me from having to go through the lengthy process of removing all gateways, remove cluster, and then reinstall all gateways following installation of new cluster on new anchor machine.

Thanks.

Viewing all 17934 articles
Browse latest View live


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