5 reasons to start using Microsoft Power BI

Ciprian Ilies - ABIT Technologies

Ciprian Ilies

July 25, 2020

Mobirise

Data is the most valuable resource on earth, and we’re generating more of it than ever. How BI tools comes into this equation and why they are needed more than ever?

Business Intelligence tools were designed to visualize and understand more easily big data. Their purpose is to understand trends and insights from your data so that you can make tactical and strategic business decisions.

There are several BI tools available on the market such as: Microsoft Power BI, Tableau, Dundas, Sisense or Zoho Analytics.

Let's dive into one of the most popular one - Microsoft Power BI

Power BI is a collection of software services, apps, and connectors that work together to turn your unrelated sources of data into coherent, visually immersive, and interactive insights. Your data may be an Excel spreadsheet, or a collection of cloud-based and on-premises hybrid data warehouses.

Power BI lets you easily connect to your data sources, visualize and discover what's important, and share that with anyone or everyone you want.

5 reasons to move forward with Microsoft Power BI.

  1. Reducing operational costs and complexity to analize the company data
  2. Scales from individuals to the organization level
  3. Excel integration, prebuilt and custom data connectors
  4. Cloud-Based solution
  5. Secure and compliant data
“Power BI has allowed us to automate mundane work, create efficient workflows, and make data-driven decisions.” - Microsoft Reference

Power BI architecture and services.

The basic structure:
  1. Dataset: is a container of data. Having the posibility to use from a large list of connectors offered by Power BI, the data could come from almost any type of modern source. For example, it might be an Excel file with some financial data or it could also be a company-owned database or a Salesforce file.
  2. Visual: is a type of chart which display the data from reports and datasets. There are many type of visuals available such as: column charts, bar charts, area charts, maps, pie charts etc..
  3. Report: is composed from one or more pages of interactive visuals, text, and graphics that together make up a single report. Power BI bases a report on a single dataset.
  4. Dashboard: it's a combination of one or more reports and one or more datasets. A dashboard collects your most important metrics, on one screen, to tell a story or answer a question.
Power BI also comes with a list of powerful components that can be used to model the data: Power Query, Power Pivot, Power View, Power Map, Power Q&A, Power BI Desktop, Power BI Website, Power BI Mobile Apps

For Developers.

Microsoft Power BI comes with two SDK capabilities:
  1. Integration with your back-end application using Microsoft.PowerBI.Api Nuget package.
  2. Embed your reports in view or edit mode using Javascript SDK. You can use their Embedded Playground to check all his capabilities.

1. Microsoft.PowerBI.Api Nuget capabilities

  1. Import API – importing Power BI desktop (.pbix files) / Excel files to Power BI
  2. Groups API – for enumerating groups (also know as workspaces)
  3. Dataset API – for creating datasets and pushing data to Power BI
  4. Dashboard API – for enumerating dashboards
  5. Tile API – for enumerating & embedding tiles in applications
Let's see some examples on how we can connect and interact with Power BI API:
              
      public class PowerBIDemo
      {
     	    public async Task< PowerBIClient > GetPowerBiClient()
      	    {
    	        var tokenCredentials = new TokenCredentials(ACCESS_TOKEN, "Bearer");
            	return new PowerBIClient(https://api.powerbi.com/, tokenCredentials);
            }

            public async Task< Report > GetReport(string workspaceId, string reportId)
            {
               PowerBIClient client = await GetPowerBiClient();
               return await client.Reports.GetReportInGroupAsync(new Guid(workspaceId), new Guid(reportId));
            }

            public async Task< Dataset > GetDataset(string workspaceId, string datasetId)
            {
               PowerBIClient client = await GetPowerBiClient();
               return await client.Datasets.GetDatasetInGroupAsync(new Guid(workspaceId), datasetId);
            }

            public async Task< Report > CloneReport(Guid workspaceId, Guid reportId, Guid newWorkspaceId, string datasetId)
            {
               PowerBIClient client = await GetPowerBiClient();
               return await client.Reports.CloneReportInGroupAsync(
                    workspaceId,
                    reportId,
                    new CloneReportRequest
                    {
                        Name = "Report_Name",
                        TargetWorkspaceId = newWorkspaceId,
                        TargetModelId = datasetId
                    });
            }

            public async Task RebindReportToNewDataset(string workspaceId, Report report, string newDatasetId)
            {
		PowerBIClient client = await GetPowerBiClient();
            	await client.Reports.RebindReportInGroupAsync(
                    new Guid(workspaceId),
                    report.Id,
                    new RebindReportRequest
                    {
                        DatasetId = newDatasetId
                    });
            }

            public async Task ImportPbixFile(Stream fileStream, string workspaceId, string templateName)
            {
            	PowerBIClient client = await GetPowerBiClient();
                Import import = await client.Imports.PostImportWithFileAsyncInGroup(new Guid(workspaceId), fileStream, templateName);
            }

      }       
              
              

2. Javascript SDK

With the JavaScript API offered by Power BI you can manage reports, navigate to pages in a report, filter a report, and handle embedding events. It is important to mention that the Javascript API offer much more options to access the pages, visuals ,filters, fields or tables then the Nuget Package.
To find all available capabilities and APIs we can access the Microsoft Power BI Embedded Playground on which we have all available types of APIs and functionalities offered by Javascript SDK. There is no need to write any code to test these APIs.
The code below shows us how we can embed a report both in view and edit mode.
              

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

	// We give All permissions to demonstrate switching between View and Edit mode and saving report.
	var permissions = models.Permissions.All;

	var config = {
	    type: 'report',
	    tokenType: tokenType == '0' ? models.TokenType.Aad : models.TokenType.Embed,
	    accessToken: txtAccessToken,
	    embedUrl: txtEmbedUrl,
	    id: txtEmbedReportId,
	    permissions: permissions,
	    //viewMode: models.ViewMode.Edit, //by default the embedding type is view mode. If we uncomment this the report will be embedded in edit mode. 
	    settings: {
	      panes: {
	        filters: {
	          visible: true
	        },
	        pageNavigation: {
	          visible: true
	        }
	      }
	    }
	};

	// Get a reference to the embedded report HTML element
	var embedContainer = $('#embedContainer')[0];

	// Embed the report and display it within the div container.
	var report = powerbi.embed(embedContainer, config);

	// Report.off removes a given event handler if it exists.
	report.off("loaded");

	// Report.on will add an event handler which prints to Log window.
	report.on("loaded", function () {
	    Log.logText("Loaded");
	});

	// Report.off removes a given event handler if it exists.
	report.off("rendered");

	// Report.on will add an event handler which prints to Log window.
	report.on("rendered", function () {
	    Log.logText("Rendered");
	});

	report.on("error", function (event) {
	    Log.log(event.detail);

	    report.off("error");
	});

	report.off("saved");
	report.on("saved", function (event) {
	    Log.log(event.detail);
	    if (event.detail.saveAs) {
	        Log.logText('In order to interact with the new report, create a new token and load the new report');
	    }
	});       
              
              

Conclusions

The large number of companies who all are working on the analytics side are using Power BI. Being in the era where the data is the most important asset, the need of visualising and understanding the data is more and more in focus. Moving forward with a BI tool is a wise decision if your mainly business focus is data.

Empower data-driven decision making across your organization!

If you find it difficult to move your data and start using Microsoft Power BI in your organization or product, we are here to help you. Contact us and the PoC is for free.

Do you like what you see?
Let's have a chat. 

SUBSCRIPTION FORM

Subscribe to our Newsletter

ABIT is an Agency that combines software development and business management  ready to get involved in innovative projects. 

Contact Info

Sanpetru, Brasov, Romania, Galaxiei Street, no. 39

We believe in Napoleon Hill's Mastermind Principle. Therefore, we know that the team is the most important piece of the puzzle that will lead us to achieve the best possible solutions.

Why ABIT?

Our Charity

We are in the process of building a free sharing resources application that will be used around the world to keep usable items out of landfill.

© 2020 ABIT - Agile Business Innovation Team. All rights reserved.