Skip to main content

Power BI Developer community December update

This blog post covers the latest updates for Power BI Developers community. Don’t forget to check out our latest developer blog post, if you haven’t done so already.

Embedded analytics

 

Here is the list of updates for Embedded Analytics…

Embed capabilities

Report load best practices

Q&A support with row-level security (RLS)

Automation & life-cycle management

Capacity workloads configuration API

Token- based identity for AAD users in SQL Azure (Preview)

New AAD application registration page for Power BI

Track workspace assignment to capacity with ‘Status’ API

Managing multi-tenancy with Power BI Embedded analytics

 

Embed capabilities

Report load best practices

Looking to improve the rendering time of your reports?

Want to ensure your end-users have the optimal experience with analytics?

We hear you! What’s important for your end-users is important for us too. We recently made significant work to improve the loading time of reports. To make sure your users enjoy and get the best experience when loading reports, please follow the guidelines in this article. Here are some of the useful tips you can find in the article:

  • Install version 2.6.5 or higher of Power BI client SDK. We continue to release more enhancements, so make sure to follow up from time to time and update your SDK version.
  • Avoid generating the embed URL yourself. Instead, make sure you get the Embed URL by calling the Get reports, Get dashboards, or Get tiles API. We added a new parameter to the URL called config, used for performance improvements.

It’s also important to build your reports to be fast and reliable in any platform. Please follow this article to make sure you use the best practices.

Q&A support with row-level security (RLS)

As described in this blog post, Q&A now supports row-level security configurations, so that a user asking questions will only get answers or suggestions that are restricted to his view of the data. You can enjoy this new capability when embedding Power BI in your application or web portal, either if you are using Q&A as part of a report, or when you embed Q&A directly into your application.

 

Automation & life-cycle management

Capacity workloads configuration API

In the last blog post we announced the availability on Azure capacities of  Dataflows and Paginated reports workloads. You can use the Power BI admin portal to enable those workloads and set the maximum memory consumed per workload. We now offer Power BI REST APIs and SDK to automatically manage workloads settings on both Power BI Embedded and Power BI Premium capacities:

  • Get Workload returns the current state of a workload (e.g. Enabled) and the maximum memory percentage that the workload can consume out of the total capacity memory.
  • Get Workloads returns the current state of specified capacity workloads. For each enabled workload, the API also returns the maximum memory percentage that the workload can consume.
  • Patch Workload changes the state of a specific workload to Enabled or Disabled. When enabling a workload, the maximum memory percentage that the workload can consume must be set as well.

Token-based identity for AAD users in Azure SQL (Preview)

Customers with data in Azure SQL, can now manage users and their access to data in SQL Azure when integrating with Power BI Embedded.

When generating the embed token, you can specify the effective identity of a user in Azure SQL by passing the AAD access token to the server. The access token will be used to pull only the relevant data for that user from Azure SQL, for that specific session.

Token-based identity can be used to manage each user’s view in SQL Azure, or to sign-in to SQL Azure as a specific customer in a multi-tenant database. It can also be used to apply row-level security on that session in SQL Azure and retrieve only the relevant data for that session, removing the need to manage row-level security in Power BI.

To use token-based identity, you first need to get an AAD access token, and then add it into the ‘identitiyBlob’ property when generating the embed token:

{
"accessLevel": "View",
"identities": [
{
"datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc"],
         “identityBlob”: {
“value”: “eyJ0eXAiOiJKV1QiLCJh….”
}
}
]
}

token-based identity only works for DirectQuery models on dedicated capacity. Learn more on how to use token-based identity with SQL Azure.

New AAD application registration page for Power BI

We have a new page to register AAD applications in Power BI. Registering applications in this page is meant for calling Power BI REST APIs. The new page will help you go through the registration process faster and smoother, with all the updated permission scopes you might need to perform operations automatically in Power BI.

The new page is used for registering new applications only. To view and edit existing applications, go to the Azure portal. Learn more on app registration process.

For embedding, we recommend to register applications as part of setting up your embedding environment.

Track workspace assignment to capacity with ‘Status’ API

Few months ago we have introduced Power BI REST APIs to allow the assignment of a workspace to a capacity, automating the process of promoting workspace to be consumed by all users.

We are now adding Workspace assignment status, that enables checking the current state of the assignment of a workspace to a capacity (e.g. CompletedSuccessfully). Checking the status API can help in few scenarios:

  • Multi- geo for compliance– When assigning a new workspace to a capacity in a different region than your home tenant, moving all the data in the workspace might take time. This API call can help you check the status of this operation.
  • ‘Zero downtime’ capacity scale– if you use the script we published last month,    checking if the workspace has been moved between capacities can be very helpful to make sure users have content available at all times, during scale-up/ down or pause.

Best practices for multi-tenancy with Power BI Embedded analytics

Many of our customers build SaaS applications that manage multiple customers (tenants). When integrating Power BI Embedded analytics into your SaaS application, you must carefully choose the tenancy model that best fits your needs. A tenancy model determines how each tenant’s data is mapped and managed within Power BI and within the storage account. Your choice of tenancy model impacts application design and management.

To help you choose the best model for your needs and your customers, we published this article    to help weigh the different options across several important evaluation criteria. We hope that this article will make it easier to build the right solution and scale to production faster.

 

Come and meet us!

Meet Power BI embedded analytics Product group in the following conferences:

 

If you are puzzled or run into few issues, be sure to check our resources that can help you get by:

  • ‘Troubleshooting’ doc to help you get by all the obstacles on your way for building a great app.
  • FAQ doc to answer all your question regarding the Product, licensing and Azure capacities.
  • Community forum for developers, to seek answers or ask any other questions you have.

 

 

Custom Visuals

Landing Page

The landing page is the first page displayed the first time the report author inserts the visual into the report. Today the first time insertion page is a permanent watermark.

As of API 2.3.0, you will be able to edit this page (watermark) and add information on how to use the visual, features, and license related issues if your visual is offering additional purchases.

How to add a landing page?

Simply add supportsLandingPage to the capabilities and set it to true, this will initialize and update your visual even before dragging any data to the visual, and it will no longer show a watermark. Now you can design your own landing page!

See this code example:
export class BarChart implements IVisual {
    //...
    private element: HTMLElement;
    private isLandingPageOn: boolean;
    private LandingPageRemoved: boolean;
    private LandingPage: d3.Selection<any>;
 
    constructor(options: VisualConstructorOptions) {
            //...
            this.element = options.element;
            //...
    }
 
    public update(options: VisualUpdateOptions) {
    //...
        this.HandleLandingPage(options);
    }
 
    private HandleLandingPage(options: VisualUpdateOptions) {
        if(!options.dataViews || !options.dataViews.length) {
            if(!this.isLandingPageOn) {
                this.isLandingPageOn = true;
                const SampleLandingPage: Element = this.createSampleLandingPage(); //create a landing page
                this.element.appendChild(SampleLandingPage);
                this.LandingPage = d3.select(SampleLandingPage);
            }
 
        } else {
                if(this.isLandingPageOn && !this.LandingPageRemoved){
                    this.LandingPageRemoved = true;
                    this.LandingPage.remove();
                }
           
        }
    }

The landing page of the bar chart from the above code:

Extending Filter Capability with Multi column filter API

Multi column filter API (Tuple Filter API) was introduced in Custom Visuals API 2.3.0.

Tuple filter API is similar to Basic filter, but it allows defining conditions for several columns and tables.

 

The following is the filter interface:


interface ITupleFilter extends IFilter {
$schema: string;
filterType: FilterType;
operator: TupleFilterOperators;
target: ITupleFilterTarget;
values: TupleValueType[];
}

Fields:

 

target: is an array of columns with table names:

declare type ITupleFilterTarget = IFilterTarget[];

The filter can address columns from different tables.

 

$schema: is “http://powerbi.com/product/schema#tuple

filterType: is FilterType.Tuple

Operator: only allows to use “In” operator

Values:  is an array of value tuples, where each tuple represents one permitted combination of the target column values.


declare type TupleValueType = ITupleElementValue[];

interface ITupleElementValue {
value: PrimitiveValueType
}

Complete example:

let target: ITupleFilterTarget = [
{
table: "DataTable",
column: "Team"
},
{
table: "DataTable",
column: "Value"
}
];

let values = [
[
// the 1st column combination value (aka column tuple/vector value) that the filter will pass through
{
value: "Team1" // the value for `Team` column of `DataTable` table
},
{
value: 5 // the value for `Value` column of `DataTable` table
}
],
[
// the 2nd column combination value (aka column tuple/vector value) that the filter will pass through
{
value: "Team2" // the value for `Team` column of `DataTable` table
},
{
value: 6 // the value for `Value` column of `DataTable` table
}
]
];

let filter: ITupleFilter = {
$schema: "http://powerbi.com/product/schema#tuple",
filterType: FilterType.Tuple,
operator: "In",
target: target,
values: values
}

 

To apply the filter with multi the new capability:
visualHost.applyJsonFilter(filter, "general", "filter", FilterAction.merge);

Note that order of column names and values of condition are sensitive.

The equivalent SQL query is:

SELECT * FROM DataTable WHERE Team = "Team1" AND Value = 5 OR Team = "Team2" AND Value = 6;

 

 

As always, feel free to use all the communication channels at your disposal to connect with our team, share your thoughts and ask questions:

  • Community
  • Contact us for support- pbicvsupport@microsoft.com

 

 

That’s all for this post. We hope you found it useful. Please continue sending us your feedback, it’s very important for us. Have an amazing feature in mind? please share it or vote in our Power BI embedded analytics Ideas forum, or our Custom Visuals Ideas forum.