Power BI Archives - Page 7 of 21 - - Page 7

Category Archives: Power BI

Embed Secure Power BI report using Python Web Application with Flask in Visual Studio 2015

In this article, we will embed a Power BI report in a python web application with flask in visual studio 2015. Following are the steps to embed a report. STEPS: Create a new Python Web Project by selecting “Web Project” under Python in Visual Studio 2. If you can’t see this option then first you have to install Python tools for visual studio 2015 2.1 Run the Visual Studio installer through Control Panel > Programs and Features, selecting Microsoft Visual Studio 2015 and then Change. 2.2 In the installer, select Modify 2.3 Select Programming Languages > Python Tools for Visual Studio and then Next: 2.4 Once Visual Studio setup is complete, install a Python interpreter of your choice. Visual Studio 2015 supports only Python 3.5 and earlier; later versions generate a message like Unsupported Python version 3.6 3. Next step to create a Python Virtual Environment. (This is not mandatory but it is advisable to create a virtual environment to avoid changes to global python installation. ) 4. Expand the project in Solution explorer and right click “Python Environments” and select “Add Virtual Environment”. Accept the default environment name “env” and create the python virtual environment. On successful creation of Virtual Environment, Visual studio would automatically point to newly created Virtual Environment instead of Global Python environment 5. Right click “env” (the name of virtual environment) and select “Install Python Package” Provide the name of the Package as “Flask” and leave the installation mode to “pip”. The alternate installation mode is “easy_install”. Wait for the installation to complete and you can view “Flask” and its dependent packages in the Solution Explorer on successful installation Now the environment is all set and the next step is to create the actual web application Add an empty Python file named “OpenPowerBIReport.py” (Solution Explorer => Add => New Item) and set it as start-up file (Right click index.py and select “Set as Start up File” in context menu) Add the below code to OpenPowerBIReport.py . The below code snippet is creates a variable by name “data” and passes its value to “index.html” when the user lands at “root” location (“/”) of the website Add two folders named “Templates” and “Static” to the project. These are the folders Flask would be looking for html files (Templates) and other assets (Static) from flask import Flask,render_template from os import environ app = Flask(__name__) @app.route(‘/’) def index(): weburl=”https://app.powerbi.com/reportEmbed?reportId=df8a34c9-b173-4449-b7e3-2cd29208cd33&autoAuth=true&ctid=26c4b2e4-ec07-4c7b-92e5-97f52865e98b&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly93YWJpLXNvdXRoLWVhc3QtYXNpYS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9” return render_template(‘PowerBIReport.html’,weburl=weburl) if __name__ == ‘__main__’: HOST = environ.get(‘SERVER_HOST’, ‘localhost’) try: PORT = int(environ.get(‘SERVER_PORT’, ‘5555’)) except ValueError: PORT = 5555 app.run(HOST, PORT,debug=True) Add a new html file named “PowerBIReport.html” inside the templates folder and copy paste the below html snippet to that file <!DOCTYPE html> <html lang=”en” xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta charset=”utf-8″ /> <title>Home Page</title> <link href=”/static/styles.css” rel=”stylesheet” /> <style> .button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } </style> </head> <body bgcolor=”#E6E6FA”> <div> <h1>Embed Power BI report in Python web apps !!</h1> <a href=”https://app.powerbi.com/reportEmbed?reportId=df8a34c9-b173-4449-b7e3-2cd29208cd33&autoAuth=true&ctid=26c4b2e4-ec07-4c7b-92e5-97f52865e98b&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly93YWJpLXNvdXRoLWVhc3QtYXNpYS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9” class=”button” target=”_blank”>Go to Power BI Report In New Tab</a> <button onclick=”location.href = ‘https://app.powerbi.com/reportEmbed?reportId=df8a34c9-b173-4449-b7e3-2cd29208cd33&autoAuth=true&ctid=26c4b2e4-ec07-4c7b-92e5-97f52865e98b&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly93YWJpLXNvdXRoLWVhc3QtYXNpYS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9‘” type=”button” class=”button”> Open Power BI Report </button> </div> <div> <iframe width=”680″ height=”510″ src=”{{ weburl }}” frameborder=”0″ allowFullScreen=”true”></iframe> </div> </body> </html> Add a new file named “style.css” to the static folder and the below css snippet to the file. This file is explicitly added to the project to show where to place static assets instead of adding inline css in html. .info {     margin:auto;     text-align:center;     padding-top:20% }12. Solution Explorer would look like the below picture after adding html and css 12. The new Embed option is available on the File menu for reports in the Power BI service. Select the Embed option to open a dialog that provides a link and an HTML snippet that can be used to embed the report securely. You’ll need to use your portal’s embed feature or edit the web page’s HTML to add the report. 13.That’s it. Hit F5 and now you can expect a website running similar to the one shown below.

Share Story :

How to set the interaction between visual in Power BI

Posted On October 10, 2019 by Yogesh Gore Posted in

Power BI provides interactive features that allow for easy navigation and filtering of the visual on click. But, we can also set the interaction between the visuals. We can have some of the visuals default to a filter functionality whereas other visuals use the highlight method. Type of Interaction No-way – no interaction between visuals One-way – interaction occurs from one visual to another, but not in the reverse direction Two-way – interaction occurs between one visual and another in both directions How to set the interaction? Go to the Edit Interactions button on the Format tab of the ribbon in Power BI Desktop. Once you click the Edit interactions button, you can now edit the interactions between the different visuals. As we can see for the Day wise Revenue card we disabled the interaction for the Month range filter and for Total Month Revenue we disabled interaction for the Day range filter. As if we select the day from the dropdown filter we can see that there is no change in Total Month Revenue. Hope this helps!

Share Story :

How to Sync Slicer in Power BI?

Posted On October 10, 2019 by Yogesh Gore Posted in

This blog will explain how to synch Slicer in Power BI desktop. In slicer syncing, all the pages where slicer has been applied will get synchronized. How to apply slicer syncing? Step1: Select “Date Selection” slicer > Open View Menu > Click “Sync slicer”. Step 2: When we click on slicer syncing it will open the setting for the slicer. Based on our requirement we can select the different combinations to apply slicer and it will get synch across all tabs. Hope this helps!

Share Story :

Remove Duplicate in Power Query

Posted On October 10, 2019 by Yogesh Gore Posted in

One can make better and faster-informed decisions when they use Microsoft Power BI Integrations. The business data that is there on your systems have a lot of information that can help you to scale up your business. You can unlock its true potential when you use business intelligence software. Microsoft is the leading company when it comes to creating products that help a business to expand beyond leaps and bounds. It is easy to learn and use. But, unfortunately not many people struggle with the software once they install it as they do not know how to use it. For example, removing duplicate in power query might look like a real struggle if you do not know how to do it. In this blog, we are going to see how to remove duplicate from the column using Power Query, as we know that we can directly apply a transformation on the column and then use remove duplicate. But there is situation when remove duplicate does not work. Situation 1:- Consider the following scenario, we have the same GUID but the case is different in that case duplicate will not get removed. Solution:- Power Query is case sensitive language here both abcdefg123  and Abcdefg123 are considered as different. If you are going to do remove duplicates despite their case of letters, then you have to apply a transformation to change them all to one case; either UPPERCASE or lowercase. Situation 2:- In other scenarios sometimes we have data with leading or trailing space is present so changing it to UPPERCASE, you would still have the extra space, which makes the two texts differ. So, to deal with that we have to use Trim Transformation to remove extra space.

Share Story :

How to set the default value in Report filter pane?

Posted On October 10, 2019 by Yogesh Gore Posted in

Microsoft Power BI Integrations, in a nutshell, is nothing but a Power BI (business intelligence) software that provides a business analytics solution. It helps companies to visualize their data and to share observations and insights across all the departments in the organizations. Management teams can make crucial decisions based on the information that comes from these reports.  Your decision making is going to be a lot better and faster when you use this particular software. In other words, it is going to make the life of every employee better as they can see where they are doing well and where exactly they need to improve. Companies can scale up high using the data.  Here’s everything that you would want to learn about this product In this blog, we are going to see how to set the default value for value in report filter pane in Power BI. Sometimes we came with a requirement to set default values in a day filter to Current Month as default. Since we cannot use DAX in report level filter directly but we can work around this issue in the following way by creating the following DAX Default Filter = IF(MONTH(Calendar[Date])=MONTH(NOW()) && YEAR(Calendar[Date])=YEAR(NOW()),”This Month”,””) You can drag the filter in the report level filter and select the value as “This Month”.

Share Story :

How to embed Power BI Report in Python Web application

In this article, we will embed a Power BI report in a python web application. Following are the steps to embed a report. STEPS: Go to Power BI web service and open the report that you want to embed in your web application, then click o the file menu and select the Embed option. The following window will pop up. Now copy the highlighted URL and save it somewhere you will need that URL later. Also copy the iframe tag in your web application’s front end logic. You can also adjust the height and width of the iframe. Now open the .py file where your routs are set. Now copy the highlighted URL and assigned it to one variable as shown below. Now remove the URL of iframe and replace it with the variable in the following way. you have to enter your Power BI credentials. The final output will look like this.Hope this helps.

Share Story :

Power BI Platform

Posted On March 6, 2019 by Subhash Mahato Posted in

Introduction: Microsoft has introduced a new platform to access the different app and analytics. You can access your different environment. 1. Power BI 2. Power apps 3. Flow Currently you might have opened few cases using this platform but there are lot more than that we can do. This is in preview mode can be available soon. Description: You can open the portal using below given URL “https://admin.powerplatform.microsoft.com/.” Once you open the portal you will be able to see the default page shown below. As you seen in the above screen shot it show open cases. Navigation menu As you can see the navigation menu contains the familiar components. Help and support This contains the cases open with Microsoft. Analytics This shows the analytics or various apps Environments User can easily navigate to the respective environment, as you can see in the below. Analytics Below details which can be viewed from the Common Data Service. Common Data Service Microsoft Flow As I don’t have any flow it is not showing anything. PowerApps Data policies You can develop your own data policies. Admin center You can navigate to the various application from the admin Center. Dynamics 365 Thi will navigate you to the Dynamics 365 instances. Microsoft Flow This will take you to the Microsoft Flows apps. Power Apps This will take you to the Apps associate with you organization. PowerBI You can view your PowerBI Reports.

Share Story :

Power BI Custom Visual Sorting

Sorting can be used for defining an order direction for your Custom Visual. There are 3 different ways using which you or a user using your visual can sort your visual. They are as follows: Default Sorting: This is the easiest sorting option and gives users the ability to sort the visual by any field used in the visual. The following code needs to be added to the capabilities.json file.  “sorting”: { “default”: { } } After this the user will get the below sorting option: Implicit Sorting: Implicit Sorting can be used for pre-defining your sorting order in your capabilities.json file. Here, the user cannot manually change the sorting order. This can be done with the following code block where direction 1 is ascending and 2 is descending. Role is the data mapping name for which you would like to define your sorting. “sorting”: {         “implicit”: {             “clauses”: [                 {                     “role”: “category”,                     “direction”: 1                 }                 ]         }     } Custom Sorting: Custom sorting can be used for defining sorting in your visual.ts file and not in the capabilities.json file. Since you are defining your sorting order in your code, you can use various different logics to define your sorting(For example, you can define a formatting toggle option in the format pane that will sort the visual when turned on). A simple codeblock that can be used for sorting your datapoints in ascending order is as follows. sort((obj2, obj1) => { if (obj2.category< obj1.category)  return -1 else return 1; }); With so many options available, it is pretty easy create a visual just the way the user wants.

Share Story :

Time Based E-mail subscription in Power BI

Posted On February 17, 2019 by Admin Posted in

Time based E-mail subscription feature is available for all Power BI Reports and Dashboards, For both in Power BI Pro and Premium Subscriptions. Now, you can set up an email subscription to run daily, weekly or any specific day of the week. Also, you can schedule for a particular time of the day. You have the flexibility to set it on the schedule you need. Now you can schedule a data set refresh at certain time and you can schedule subscription on another time. To set the Subscription, Click on the “Subscribe” button in toolbar above the dashboard or report. You can create a new email subscription, or you can edit the existing subscription email. Now, we will see subscription by default as in time-based schedule. Refer below screen capture: Now you have option to select frequency option as Daily, Weekly and After data refresh (once daily).

Share Story :

Hide table or column in Power BI

Posted On January 30, 2019 by Admin Posted in

Introduction: In this article we will read on how to hide a table or column in Power BI Web Service. Scenario: I have a Power BI Report with 3 Tables; Orders, People and Returns. I want to hide People table when I am publishing the Power BI Report on Power BI Web Service. Steps: Open Power BI desktop file. Right click on the table or column you want to hide Select Hide. Voila! You are done. The Table People we not be visible in the Fields section of Power BI Desktop file. You can find the table in the Modelling view as a Grey table.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange