Tutorials – bConcepts https://www.bconcepts.pt Wed, 26 Jul 2023 19:50:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.2 Power BI Report Server Configuration and Security Implementation https://www.bconcepts.pt/en-power-bi-report-server-configuration-and-security-implementation/ https://www.bconcepts.pt/en-power-bi-report-server-configuration-and-security-implementation/#respond Wed, 26 Jul 2023 19:46:03 +0000 https://www.bconcepts.pt/?p=5768

One of the recent data visualization tools that is being very popular among the customers is Power BI. As the tool is new and Microsoft is enhancing their features day by day, there are issues, a developer could face that has never been encountered earlier.

As a developer, I have a chance to work dedicatedly from installing the report server configuring them, apply the Brand Package and manage security implementation on the reports.

This document will describe configuration and security implementations steps for Power BI Report Server, hoping to help other people with similar Implementation.

What is Power BI Report Server?

Power Bi Report Server is an on premise report server with a web portal in which you display and manage reports and KPIs. Along with it come the tools to create power bi reports, paginated reports, mobile reports and KPIs. Power BI Report Server is an extension of SSRS with similar look and feel, just enhanced functionality to host PBIX reports.

Bconcetps Power BI Report Server Configuration and Security ImplementationCreate, deploy, and manage Power BI, mobile and paginated reports on premises with the range of ready-to-use tools and services that Power BI Report Server provides.

Components and Requirements

Power BI Report Server

The installation is straightforward and Microsoft documents are helpful enough to install successfully.

You can follow the link below,

https://docs.microsoft.com/en-us/power-bi/report-server/install-report-server

We have used below system configuration:

RAM: 32 GB

Windows Server: 2016 Datacenter

System Type: 64-bit Operating System, x64-based processor

Database: SQL Server 2016 SP2 Enterprise Edition

ORACLE Client

Reports, we are working, are based on ORACLE. Once the reports are published into the report server, it will use the server machine settings to run them. Therefore, it needs ORACLE client to be installed on the server itself.

SQL Server Database

Just like SSRS, Power BI Report Server also uses two SQL Server DBs to store report server object metadata. Therefore, there should be a SQL server enterprise instance installed locally or remotely.

Challenges and Mitigations

  • The user must be a part of local admin group.
  • TNSNAMES.ORA file should be configured properly with TNS alias name for the DB connection.
  • The path of the TNSNAMES.ORA file to be set in environment variable ‘TNS_ADMIN’. Check Oracle bin folder for ORACLE.KEY file to see where to add TNS_ADMIN variable.
  • The Oracle bin path to be set with admin privileges.
  • That should be the Enterprise Edition of SQL server. Developer Edition or RDS will not help.
  • We have used SQL Server 2016 SP2 Enterprise Edition

Configure Report Server

After installing the Power BI Report Server, we need to configure the report service from Report Server Configuration Manager.

The steps are simple and directed in Microsoft docs. PFB the link:

https://docs.microsoft.com/en-us/power-bi/report-server/install-report-server

We have used below details, which worked successfully.

  • Service Account

My domain user account credentials.

Web Service URL

  • Virtual Directory: <Any meaningful name that describes the purpose>
  • IP Address: All Assigned
  • TCP Port: 80
  • The URL will be generated automatically

Database

Go to Change Database and point the report server to the SQL Server Enterprise Edition instance. PFB the link:

https://docs.microsoft.com/en-gb/sql/reporting-services/install-windows/ssrs-report-server-create-a-report-server-database?view=sql-server-2017

Web Portal URL

  • Virtual Directory: <Any name that would be used in the URL>
  • The URL will be generated automatically

Note: The rest is not required for the basic configuration.

Challenges and Mitigations

  • Network Issues:

If you get any network related error,

  1. You can check if the connection properties have “Obtain DNS Server Address Automatically” checked. You can check it from, Control Panel >> Network and Internet >> Network Connections >> Right Click on the Connection >> Properties >> TCP IPv4 >> Properties >> Select Obtain DNS Server Address Automatically.
  2. Check if TCP/IP is enabled on the machine.
  3. Check if the TCP port is open.
  4. Check if the SQL Server metadata DB is in the same domain and firewall is not blocking anything.
  • Database Permission Issues:

If you get any DB related error,

  1. The SQL server should be the Enterprise Edition. RDS instance or Developer Edition will not work.
  2. The User credentials used to configure the DB should have SYSADMIN and Public roles on the SQL Server.
  3. Local installation and remote instance both will work. PFB the link:

https://docs.microsoft.com/en-gb/sql/reporting-services/install-windows/configure-a-report-server-database-connection-ssrs-configuration-manager?view=sql-server-2017

Connecting to Report Server DB

You can connect to the report server DB instance from SQL Server Management Studio to check if the user has the roles required or the DBs are created.

Challenges and Mitigations

  • If there is any issue logging in, first check with the admin if you have the correct credentials.
  • The server name will be <hostname>, <port no>.
    Ex. 150.9.8.15, 1166
  • If there is any problem logging in from the server machine, try to log in from any other machine in the same domain.

Connecting to Report Service

After successfully configuring the report server, you should be able to log in to the reporting service from SQL Server Management Studio. This can be used to check the default roles, create or edit new roles and manage the scheduling.

If the server is configured correctly, you will be able to see ‘PowerBIReportServer’ service running on the machine where server is installed.

You can connect to the reporting service from SQL Server Management Studio. Go to object explorer and select ‘Reporting Services’. You should see the Reporting Server instance in the dropdown. Enter credentials and Log in.

Challenges and Mitigations

  • If there is no instance in the dropdown, you need to register the service in SSMS. In order to do that,

View >> Registered Servers >> Reporting Services >> Local Server Groups >> Right Click >> New Server Registration >> Put the ‘Web Service URL’ and test.

Start the web portal

  1. Open your web browser. Learn about what browser versions are supported for managing and viewing Power BI Report Server and the Report Viewer Controls. See this list of supported web browsers and versions.
  2. In the address bar, type the web portal URL.
  3. By default, the URL is [https://[ComputerName]/reports%3c/a%3e.%3c/li%3e/r/n]https://[ComputerName]/reports.
  4. The report server might be configured to use a specific port. For example,
    [https://[ComputerName]:80/reports%3c/a]https://[ComputerName]:80/reports
    Or
    [https://[ComputerName]:8080/reports%3c/a%3e%3c/li%3e/r/n%3c/ol%3e/r/n%3cp%3eYou]https://[ComputerName]:8080/reports

You can use the web portal to perform the following tasks:

  • View, search, print, and subscribe to reports.
  • Create, secure, and maintain the folder hierarchy to organize items on the server.
  • Configure role-based security that determines access to items and operations.
  • Configure report execution properties, report history, and report parameters.
  • Create shared schedules and shared data sources to make schedules and data source connections more manageable.
  • Create data-driven subscriptions that role out reports to a large recipient list.
  • Create linked reports to reuse and repurpose an existing report in different ways.
  • Download common tools such as Report Builder and Mobile Report Publisher.
  • Create KPIs.
  • Send feedback or make feature requests.

Publishing Report to the Report Server

After you are done with configuring the report server successfully, you should be able to access it through the Web Portal URL. You can use the same URL to save the reports to the report server.

Bconcetps Power BI Report Server Configuration and Security ImplementationChallenges and Mitigations

  • Check if the URL is correct
  • Check if you are logged in to the server with the same credentials
  • You can get some “Unexpected Error Encountered” while saving the reports to the report server. You can use the Upload functionality from the web portal itself.

Manage Security on the Server

There are cases when you might have to set some security to the folders, objects and the reports in the server based on the users or user groups created in the domain. For this, you can use Manage functionality from the web portal and assign roles to the users. PFB the link:

You have essentially three layers of access to the report file security in Power BI Report Server.

  • The portal itself can be secured. You can and should limit access to the reports by only allowing specific users or group’s access to the report portal.
  • Folders can be used to provide more granular security over a group of assets in the report portal. In the image above, I created a folder called PBI Secure Reports. A specific AD group has access to this folder. If a user does not have permissions to the folder, the folder does not show up in the portal and they cannot access the folder or the assets, including Power BI reports, stored in this folder.
  • Individual reports can be secured as well. I never recommend this option as it becomes administratively difficult to manage. However, the capability is there is a single asset needs to be secured in this fashion.

Mapping SSRS Roles to Power BI Functions

The portal, folders, and files are secured using SSRS roles. Here is a high-level summary of the roles and how it affects Power BI Reports.

Bconcetps Power BI Report Server Configuration and Security Implementation

  • Browser – This is similar to a read only function or if you would deliver the report as a Power BI App in the service. This should be used by anyone who needs access to the report, but does not create content.
  • Content Manager – This is for a content creator with admin privileges. This role can manage content and user access.
  • Publisher – This is for content creators who do not need to manage users. Most content creators fall into this category.
  • Report Builder – does not apply to Power BI Reports, which use Power BI Desktop to develop reports.

https://docs.microsoft.com/en-us/power-bi/report-server/admin-handbook-overview

Challenges and Mitigations

  • The user must be granted access to the report server.
  • In order to manage security from the web portal, the user must be a part of local admin group.
  • The user, on which security is applied, cannot be a part of local administrator group. Users in admin group will by default have access to all the folder objects irrespective of the security.

Avoid Deploying to the Portal Home Page

I would recommend you not allow Power BI reports to be deployed to the primary portal, but create folders to manage the group of content creators and managers based on the department or group level needs.

Reports deployed to the home page of the portal should be managed as enterprise assets. Use the folders and related security groups to manage who can deploy at this level.

Branding the web portal

You can alter the appearance of the web portal by branding it to your business. This is done through a brand package. The brand package is designed so you do not need deep cascading style sheet (CSS) knowledge to create it.

Creating the brand package

A brand package for Reporting Services consists of three items and is packaged as a zip file.

  • color.json
  • metadata.xml
  • logo.png (optional)

Applying the brand package to the web portal

To add, download, or remove a brand package, you can do the following.

  1. Select the gear in the upper right.
  2. Select Site Settings.Bconcetps Power BI Report Server Configuration and Security Implementation
  3. Select Branding.Bconcetps Power BI Report Server Configuration and Security Implementation

Currently installed brand package will either display the name of the package that has been uploaded, or it will display none.

Upload brand package will apply the package to the web portal. You will see it take effect immediately.

You can also Download or Remove the package. Removing the package will reset the web portal to the default brand immediately.

The steps are simple and directed in Microsoft docs. PFB the link:

https://docs.microsoft.com/en-us/sql/reporting-services/branding-the-web-portal?view=sql-server-2017

For Example,

Before Applying brand package – This is a by default package for Power BI Report Server

Bconcetps Power BI Report Server Configuration and Security ImplementationAfter Applying brand package – This is a XBOX brand Package

Bconcetps Power BI Report Server Configuration and Security Implementation

Bconcetps Power BI Report Server Configuration and Security Implementation

Wrap Up

I would like to extend a special thanks to Nityanand and Rudra for their guidance and support on implementing Power BI Report Server. Thanks Nitin for the help on this topic.

]]>
https://www.bconcepts.pt/en-power-bi-report-server-configuration-and-security-implementation/feed/ 0
Power BI – Finding total number of rows in a table https://www.bconcepts.pt/power-bi-finding-total-number-of-rows-in-a-table/ https://www.bconcepts.pt/power-bi-finding-total-number-of-rows-in-a-table/#respond Wed, 26 Jul 2023 19:39:10 +0000 https://www.bconcepts.pt/?p=5759

INTRODUCTION AND USE CASE

In PowerBI we can’t select entire the column and see the number of rows in the table. To do this we have to export the data in excel and then we can do it by selecting the column.

In the scenario we have a table with different column and when I drag the columns in the table visual, I could see the values are grouped based on the selected columns. But when I try to find the number of rows on the grouped column then I got the actual problem.

The COUNTROWS() function works differently and doesn’t provided the expected result.

The Rank() function has different problem, either it got tied or when the values are filtered then it won’t provide the expected result.

POWERBI CONCATE ()

Using CONCATE function is best way to find the correct answer on getting the total number of rows in table visual.

Below steps are followed to achieve the total number of rows in table visual when applying filter as well.

  1. Use CONCAT() function with all possible combination of columns
  2. If the table has more than 2 possible combination, then use the & symbol in between the columns.
  3. Once the calculated column is created, then drag the column into the end of table value visual.
  4. Finally, change column value as Count(distinct) in value menu.

Sample Report Output:

The below report crated with the sample data which shows how to apply the logic.

Person table:

Power BI - Finding total number of rows in a table

Report design:

Power BI - Finding total number of rows in a table

Negative Output 1: when using COUNTROWS() function – using Count

The expected output of total number of rows is 4.

Power BI - Finding total number of rows in a table Power BI - Finding total number of rows in a table

Negative Output 2: when using COUNTROWS() function – using Count (Distinct)

The expected output of total number of rows is 4.

Power BI - Finding total number of rows in a tablePower BI - Finding total number of rows in a table

Correct Output 1: when using CONCAT() function – using Count (Distinct)

The below output provides the correct expected value as 4.

Power BI - Finding total number of rows in a tablePower BI - Finding total number of rows in a table

Correct Output 2: when using CONCAT() function – using Count (Distinct)

The below output provides the correct expected value as 2 using filtered values.

Power BI - Finding total number of rows in a table

Formula used for CONCAT():

Concat = CONCATENATE(Person[Column1]&Person[Column2],Person[Column4])

Conclusion:

This use case is mainly concerned about the total number of rows when the values are grouped and when filter applies so the CONCAT() function gives the exact expected output even when the filter applies. The same can’t possible by using RANK(), COUNTROWS() Or COUNT by column functions.

]]>
https://www.bconcepts.pt/power-bi-finding-total-number-of-rows-in-a-table/feed/ 0
PowerBI Best Practices https://www.bconcepts.pt/powerbi-best-practices/ https://www.bconcepts.pt/powerbi-best-practices/#respond Sat, 15 Jul 2023 08:57:36 +0000 https://www.bconcepts.pt/?p=5723

Power BI is a collection of software services, apps, and connectors that work together to turn 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.

  • With Power BI, one can retrieve data from hundreds of data sources, shape the data to fit your specific requirements, perform ad hoc analytics, and present the results through various types of visualizations
  • The Power BI service lies at the heart of the Power BI offering, providing a cloud-based platform for connecting to data and building reports. Users can access the service through a web-based portal that provides the tools necessary to retrieve, transform and present business data
  • Power BI Desktop is a downloadable application that Microsoft provides for free. The application is essentially a report-building tool that provides capabilities similar to the Power BI service
  • With Power BI Desktop, one can build advanced data queries and models, create sophisticated reports and visualizations, and publish the consolidated report packages to the Power BI service or Power BI Report Server.
  • Power BI Desktop can be divided into three categories, or views, for how we interact with data and create reports:
    Report view: A canvas for building and viewing reports based on the datasets defined in Dataview.
    Data view: Defined datasets based on data retrieved from one or more data sources
    Relationships view: Identified relationships between the datasets defined in Data view

Power BI dashboards

With updates to Power BI customers can now see all their data through a single pane of glass. Live Power BI dashboards show visualizations and KPIs from data that reside both on-premises and in the cloud, providing a consolidated view across their business regardless of where their data lives.

Simplifying how we interact with data, natural language query is built into the dashboard allowing users to type questions and receive answers from data in the form of interactive visualizations.

One can explore their data further by drilling through the dashboard into the underlying reports, discovering new insights that they can pin back to the dashboard to monitor performance going forward.

Key Components

Features

  • One of the really unique things about Power BI that separates Power BI from a lot of the other BI tools out there is the really tight integration between Power BI and Excel. Excel and Power BI contain a portfolio of tools that is unique in the industry. Together, they enable business analysts to more easily gather, shape, analyse, and visually explore their data.
    In addition to viewing Power BI reports in the web portal, business users can now do the same with Excel workbooks in the new version of Power BI Report Server, giving them a single location to publish and view their self-service Microsoft BI content.
  • Seamless integration across Office and Azure provides quicker and more cost-effective deployment for any data project.
  • Power BI provides a strong backend data manipulation feature with access to simple visualization
  • Power BI covers most of the data sources available in Tableau. It is closely integrated with Office 365, hence provides connectivity to SharePoint.
  • Power BI online version also supports direct visualization on Search Engine
  • Power BI uses cloud storage and includes simple implementation process.
  • Microsoft Power BI hosts one of the most user-friendly data visualization tools in the business intelligence market. The drag-and-drop functionality of the software, along with access to over 85 data visualization applications, provides an uncomplicated experience that results in visually appealing and informative reports
  • Reports generated in Microsoft Power BI can be exported as PDF, TIFF, HTML and Microsoft Office files. Power BI files include desktop files (pbix) and templates (pbit). With Microsoft as the engine behind Power BI, report exporting and document access is simple.
  • Microsoft Power BI possesses the advantage of Microsoft’s familiarity and connections to assorted applications. Users of Microsoft Power BI can mine data from programs such as Microsoft Excel, Google Analytics, MySQL, Oracle, Salesforce, Mail Chimp, Facebook and Zendesk, with new data sources added every month
  • The Microsoft foundation of this analytic tool ensures a smooth meshing of Power BI with the existing work base of a business. One of the more innovative features of Microsoft Power BI is the ability to use browser- and desktop-based authoring with apps and platforms that are both on-premise and in the cloud. This hybrid integration strategy is based on the Microsoft Azure Cloud APIs.
  • The Microsoft backing of the Power BI platform ensures simple integration with a number of external applications. Nearly every program that works with Microsoft can integrate with Power BI, offering an expansive library of possible collaboration options.
  • In conjunction with other Microsoft offerings, including Azure, SQL Server Analysis, real-time data streaming and R-analytics, Power BI provides a broad analytics landscape. Connect Power BI to in-house data sources or external sources like Hadoop, Azure HDInsight and Spark for a full range of data access. Open database connectivity integration provides access to big data sources. Users can visualize, analyze, report and share data pulled from ODBC source
  • Power BI presents databases in a menu view where users can simply select their data source of choice, connect to the data and begin the process of analysis and reporting
  • Have extensive R and big data-related integrations, ensuring this apps’ scalability for larger projects.
  • A highlighting feature is provision of APIs where developers can club Power BI dashboards to other products.
  • Microsoft provides integration abilities that are simply unmatched by competitors, resulting in one of the most user-friendly, data-connected business intelligence systems available.

Overall Flow

PowerBI-Best Practices Bconcepts

Best Practices to be followed:

  1. Keep a Last Refreshed Date’ Exists in the Dataset – The objective is for report consumers to understand the effective date of the data being displayed
  2. Parameterize data source connections. Parameters can be useful to minimize hard-coding and reduce maintenance during future changes.
  3. Hide field that is not utilized in the visuals – IDs and surrogate keys are needed for relationships, but are not useful for visuals. Hiding them simplifies the data model because there’s less fields shown in the field list.
  4. For performance optimization purposes, the most selective condition should typically be nested to limit data as early as possible.
  5. Keep measures simple initially, and add complexity incrementally. ie Break Measures into Interim Parts
  6. Description for Query – If a query is doing something unusual, or is serving as an intermediary query, it is very helpful to include a description of the purpose for the query.
  7. Comments in the M Query can be very helpful to describe the data transformations which are occurring.
  8. Comments in DAX can be very helpful to describe what’s happening in a calculation. This can be to help others understand the calculation
  9. Split date and time – Always split it in two columns, one for DATE, and one for TIME. Reduce precision of TIME if necessary down to hour, minute, or seconds, according to business requirements. High cardinality columns are expensive in Power BI, and a datetime column will likely have a unique value for each row. By splitting that information in date and time will save memory, increase performance, and make the data model easier to use.
  10. Apply Mark as “Date Table” to tables with dates – Time intelligence functions require to mark a table as a Date table if a surrogate key column (typically an integer) is used in the relationship between a fact table and a dimension.
  11. Create a common theme/look for the report, and apply it to all pages of the report.
  12. Set the Data Category – Address related columns, such as city/state/zip and so forth, need to be specified in the data model to ensure geocoding can occur properly.
  13. Create Hierarchies for usability – Date columns (such as Year>Quarter>Month) are a common scenario for use of a hierarchy and should be present in most models. Geography columns (such as Country>State>City) are great candidates as well.
  14. Be Consistent with font size, font type , font color and page background color.
  15. Version the report copies with the date as shown below Report Name vYYYYMMDD
  16. Consider Using the Divide() Function – Instead of Column A / Column B use Divide function. This standard practice prevents invalid numbers being displayed on reports. (nulls or coding around divide-by-zero errors).
  17. Include only the columns in the dataset that are useful and will be used in the Power BI reports. If a column doesn’t contribute to a visual, calculation, or a relationship, then do not import it to the model.
  18. Always use table names for column reference even when you define a calculated column within a table
  19. Provide meaningful and helpful names for the pages/tabs.
  20. Be consistent with respect to spaces, casing, and abbreviations.
  21. Create unique field names across the entire dataset – Although the Power BI permits columns to exist which are named the same across tables, that is a poor practice to allow in a data model. The name assigned needs to be self-explanatory on its own rather than relying on the context of its table.
]]>
https://www.bconcepts.pt/powerbi-best-practices/feed/ 0
Power BI – How to import a Table from SQL Server on-permisses https://www.bconcepts.pt/power-bi-how-to-import-a-table-from-sql-server-on-permisses/ https://www.bconcepts.pt/power-bi-how-to-import-a-table-from-sql-server-on-permisses/#respond Fri, 14 Jul 2023 20:36:31 +0000 https://www.bconcepts.pt/?p=5693

Power BI – How to import a Table from SQL Server on-permisses

On this video you will learn How to import a Table from SQL Server into Power BI Report.

If you need to know how to import an Excel sheet to Power BI take a look on this video first.

You need help with your data or reporting project?

Please contact us on info@bconcepts.pt or send a message on contacts page, we have a team that will be able to help you.

]]>
https://www.bconcepts.pt/power-bi-how-to-import-a-table-from-sql-server-on-permisses/feed/ 0