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.
Here is the list of updates for this month-
Automation & life-cycle management
Power BI visuals’ Platform
Automation & life-cycle management
Explore Power BI API with ‘Try-it’ tool
We are very happy to announce that Power BI now offers a new tool to interactively explore Power BI REST API without any code. Anyone with a Power BI license can log into his account and see how the API works, get information or perform operation on Power BI artifacts you have access to.
‘Try-it’ enables you to explore how each REST call works, what are the required params, structure of response or errors, and what data comes back, all within a minute!
How can I use ‘Try-it’?
- Go to Power BI REST API documentation
- Choose a specific API call that you wish to use or explore. Inside the documentation you will find the HTTP URL structure. On the top-right corner you will find a green button with the text ‘Try it’. Click on the green button.
- Once clicked, a right pane will open, asking you to sign in to your AAD account.
- After signing in, the Tool will open in the right pane. You can add parameters to the call to get specific result. Some calls require to mention specific parameters. For example, ‘Get Reports In Group’ needs the Workspace (group) ID to perform the call.
- Click ‘Run’ and see the response.
Upload Datasets only with ‘Import’ API
Power BI APIs allows you to upload content into a workspace using the ‘Import’ API, which uploads a PBIX file. As we know, a PBIX contains both a report and a dataset, and they are uploaded together.
There are cases where this coupling is not optimal, and you might prefer to handle each object separately for automation scenarios. So in order to manage datasets separately from reports, we added ‘skipReport’ parameter to the ‘Import’ API that only uploads the dataset into the specified workspace.
This new API can be useful in few cases:
- A BI developer has made a change in the model only, and he doesn’t want to override the connected report in the PBIX. He can use the API to update only the dataset, without changing any of the reports bound to this dataset.
- Update a bulk of datasets with the same schema, but different data (for different customers), without worrying if a report might be damaged from the update.
- If you are an ISV and you have a new customer, you want to clone the golden analytics package for that customer, as recommended here. You can now upload only the relevant dataset, and then connect all the reports bounded to it through ‘Clone’ and ‘rebind’ APIs.
Refresh user permissions programmatically
When Power BI users are granted permissions to Power BI content, the refresh of permission is not always immediate and can take up to an hour in some cases. A common example for a delay in permissions refresh is when sharing content with a security group. If those users log into Power BI portal, his permissions are refreshed automatically, and he can see all the latest content he has access to. However, for Power BI users consuming content through external applications that embed Power BI content, the update in some cases will not happen immediately and users will not see or access new reports that were just shared with them.
The new ‘refresh user permissions’ API will run an update behind the scenes of the user permissions and make sure he can access everything he has permissions to, while avoiding the unpleasant scenarios described above.
We recommend calling this API at the beginning of every user session in your external application.
‘Key influencers’ AI visual available in embedded reports
AI can aid in data exploration by combing through the data to automatically find patterns, help users understand what the data means, and predict future outcomes. Power BI Embedded has been a pioneer in applying AI through natural language, which enables users to get answers by asking questions in plain English. We’re bringing more AI backed capabilities to Power BI Embedded analytics by delivering the key influencers analysis.
The Key influencers visual surfaces what factors influence a KPI’s rise or fall. For example, you want to analyze the factors that impact the user satisfaction of a product they bought from you. Factors that can impact this KPI can be the type of product they bought, the price, or even if the user is a first-time buyer vs a returning customer.
Machine learning is used to rank influencers, from most to least impactful, and a likelihood score and text description is provided to explain the impact. Users can drill into a factor to see the distribution of their data for that variable/category. As users interact with their reports, either through filtering or selecting visuals, the key drivers are re-evaluated and updated in real time.
Auto- install Apps for consumers of embedded content
Power BI Apps help organizations distribute collection of analytics to end users. Apps can be a good way to organize and distribute content for Power BI users who consume content in an external portal/ domain, and not through powerbi.com.
However, there’s a specific caveat to using Apps- users must have the App installed before they can access content. If they consume through powerbi.com, that’s not really a problem, but for users who consume embedded content, that can be blocker. They don’t want to go into the portal just to install the App, and some of those users don’t know how to use Power BI portal.
To overcome this, we added the option to auto install Apps for users when opening an embedded report/ dashboard. As the developer, you should first make sure you install the app yourself to be able to get the appId (either through the URL in the portal, or through API). Once acquired, you can add the parameter
‘&appId=bf98…’ to the end user’s embedUrl. Then, when a user tries to open a report from an uninstalled App, the App will be auto installed in the background, and the report will open for that user.
In the past 2 months we added some accessibility improvements to applications using Power BI embedded analytics:
- Allow keyboard navigation on elements appearing after the embedded report– In the new experience, pressing ‘Tab’ when focused on the embedded report will focus on the next tab-able element. To navigate inside the embedded report, press ‘ctrl’+’Enter’ when focused on the report. Pressing ‘Esc’ will exit PBI report navigation mode and focus back on the embedded report.
- Allow developers to set the title attribute to the PBI Iframe for narration purposes.
- Allow developers to set ‘tabIndex’ CSS attribute to the embedded element for tabbing and focusing purposes.
About a year ago, we added the capability for passing through the identity of the current user to the underlying SQL database, enabling a new form of a role based security implemented at the database level and not in Power BI. This mechanism of role-based security is compelling in implementations where there is already a rich set of security rules defined in the database. This feature can be used when embedding for non- Power BI users, so it is useful even if your SQL users are not Power BI users.
The new E2E sample provides a simple .net web application that authenticates an application user via AAD, generates the necessary AAD token for SQL Azure, and then generates a Power BI Embed token that passes through the AAD token to SQL Azure. The sample includes a detailed step by step guide for setting up all the configuration steps necessary within the different products.
If you are puzzled or run into a 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.
Power BI Visuals Platform
New version of powerbi-visual-tools
We are excited to announce that the new release of powerbi-visuals-tools v3 is now available!
This release brings a lot of new features and goodies for the Power BI visuals development experience.
With new Typescript v3 and support for ES6 modules, users can integrate modern versions of all popular libraries like D3 and v5.
What’s new in powerbi-visuals-tools v3?
- TypeScript v3.0.1 by default
- ES6 modules supported
- New versions of D3v5 and other external libraries are supported
- Reduced package size
- Improved API performance
How to start using the new release?
For the full details and migration guide for powerbi-visuals-tools v3, please check this article.
Please note that this toolset version is 3.1 which currently supports API v2.6.0.
Starting from our next release, the toolset will only support the modern toolset version as specified above. This means that future API versions will only be supported using the modern toolset.
For any question and help please contact firstname.lastname@example.org
PowerKPI and PowerKPI Matrix visuals
The source code of our PowerKPI and PowerKPI Matrix visual is now available in GitHub!
It’s time to view, edit and extend!
Power BI visuals welcome React Framework
- Find here a step-by-step tutorial with detailed instructions on how to create simple CircleCard visuals with React.
- If you’re looking for more advanced examples, check out our SampleBarChart-react
New features for API v2.6.0
Total and Subtotal API
This API enables matrix data-view custom visuals to request extra aggregated subtotal data from the Power BI host. The subtotals can be requested for the entire matrix dataset as well as fine-tuned for individual levels of the matrix data hierarchy (see below a sample report). The requests are applicable to bigger datasets and are highly efficient since the calculations are performed by the Power BI backend.
Every time a visual needs to refresh its data, it issues a data fetch request to the Power BI backend. The data the visual ordinarily requests is the values of the fields the user dragged into the field wells of the visual. In certain scenarios the visual may need to additionally request some aggregations/subtotals (e.g., sum, count) applied to the above fields. The API customizes the outgoing data query to request for the extra aggregation/subtotal data.
Without the API the visual would need to calculate the aggregations on its own. This would have been either computationally expensive (as opposed to backend calculations) or impossible since the bigger datasets can’t be fully fetched to the visual, resulting in data being cut off and the result of the calculation being incorrect. For each data-view type (currently just the matrix) the API offers Boolean customization switches, as listed below:
– Indicates if the subtotal data should be requested for all fields in the rows field well
– Indicates if the subtotal data can be toggled for individual fields in the rows field well
– Indicates if the subtotal data should be requested for all fields in the columns field well
– Indicates if the subtotal data can be toggled for individual fields in the columns field well
– Unlike all other properties, this property is applied to individual rows/columns. The property indicates if the subtotals are requested for the row/column
Each of the switches above gets assigned a value based on the values of the related properties in the property pane and the defaults. In the capabilities file, the visual has to specify a property each of the above switches maps to and also provide the default value to be used if the property is undefined.
The switches all look like this:
The above, for example, indicates (to the standard logic) that the row subtotals are enabled by the property “rowSubtotals” in the “subTotals” object. And, if the value is supplied in the dataview (which happens if the property is not dirty), the default value of “true” will be assumed by the customization logic.
The API is automatically enabled for a visual whenever the subtotals structure and all the switch mappings are defined in the capabilities JSON file.
Below is an example of the complete API configuration in the capabilities JSON file (copied from the API sample visual):
Please note that it’s important that the enumerateProperities() function of the visual is aligned with the defaults specified in the capabilities. E.g., if no properties are hanged by the user (no properties are dirty) the properties pane will display the subtotal defaults returned by enumerateProperties(). At the same time, the customization logic will operate according to the defaults specified in the capabilities (since no objects will be supplied in the dataview). Now, the two must be aligned. Otherwise, the actual subtotal customizations will differ from the user’s perception.
Check out this link for a sample. The sample report is in the DOC folder.
The visual is a functionally-reduced version of the native Matrix visual that offers the same subtotal-related customizations that are available in the Matrix visual.
To review the available customizations please expand the Subtotals drop-down menu in the property pane, modify the subtotals settings, and track the changes to the subtotals presentation (named Totals) by the visual.
In-focus edit API
Power BI visuals created with our SDK (aka custom visuals) can now enter focus mode programmatically with the new 2.6 API call in the visualHost:
switchFocusModeState: (on: boolean) => void
on – when true the visual will enter focus mode, when false the visual will exit focus mode.
The flag isInFocus in VisualUpdateOptions can be checked to find out if the visual is in a focus mode or not.
As always, feel free to use all the communication channels at your disposal to connect with our team, share your thoughts and ask questions:
Come and meet us!
- Microsoft Business Applications Summit– upcoming sessions:
- Microsoft Power BI: Developing with Power BI embedding
- Microsoft Power BI: Introduction to Embedded Analytics
- Power BI Developer in a Day
- Deliver a powerful data story with Power BI visuals
- How to build a custom visual for Power BI
- Deliver a powerful data story with Power BI visuals
- Microsoft Inspire– upcoming sessions:
That’s all for this post. We hope you found it useful. Please continue sending us your feedback, and 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.