Showing posts with label PowerBI. Show all posts
Showing posts with label PowerBI. Show all posts

Wednesday, October 3, 2018

how to embed a PowerBI report into HTML code

PowerBI is a powerful reporting solution for Business Intelligence for analytical reports, it is not meant to replace SSRS, the focus of this tool is to be able to visualize data interactively from different data sources in a collaborative way.

On this post I will show you a quick way to embed your PowerBI reports into HTML code, that can help you to publish reports to websites.


For this, you will need a PowerBI Pro subscription (you can try it by free for 60 days)
Once you are logged to your PowerBI Pro account, select any published report you want to embed, as follows (for this example I will use a test report I have with imported dataset)

Generating HTML code for the report


Click on File and select Publish to web



A message to create an embed code will appear, click on it



A warning will also appear since your data will be public, click on publish



And that is all, now you have your HTML code to share it wherever you want.




What if you want to stop sharing it?


Maybe you should not reveal all the data from a report, or you want to stop sharing it, you must delete the embedded code to achieve it.

In your PowerBI site, click on Settings> Manage Embed codes



In the next page, click on (...) and click on delete




Published report


This is the final result of the published report:


Tuesday, July 17, 2018

PowerBI: Implement a What If parameter

Our Guinea Pig Dashboard
PowerBI is focused on creating interactive, analytical reports, from a lot of different data sources and with the ability to access them via mobile devices.

One of the cool options that allow your reports to be interactive, is the What If parameters: they allow you to visualize how your data could/should behave under different scenarios.
On this post, I will show you a super simple way to use a what if parameter.

Note: This test was done using PowerBI desktop and the Import option in the data source selection.



We will use a simple Dashboard representing sales by region in a specific year, as this:



Let's say we want to plan next year sales, we want to add a line representing the next year target by region, for this example just as a value between 0 and 200% of this year sales.

Adding the What If Parameter


Click on the Modeling Tab and select the New Parameter option.



A new window will open, here you configure the values for your parameter.
For this example, we configure a decimal value between 0 and 2.
Leave the Add Slicer option checked to add the value selection box to your dashboard.


The parameter visualization is added, but as a multiple select option.



We change the type of slicer to Single value (you can select other option if you want).




Adding a new measure


We will demonstrate how the newly created parameter works using a measure, it will multiply the year sales by the value we select in the slicer.
Of course you can use the parameter in more complex formulas, that modify data values more in depth, that are not so obvious as our example, but for now, we will keep it simple.

We proceed to create a new measure on our data table, select the header of the table and select the New Measure option.



Then enter the formula you want to use, for our example the sum of the sales of the year, multiplied by our parameter, to simulate next year sales.



You can see how the measure is visualized as any other column in our table



Modify your visualizations


Now, just modify the dashboard by adding the new column to any visualization you want and save it.
Then you can change your slicer and the column will change its value in real time.

A simple analytical report with a few clicks :)


Sources:

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

https://docs.microsoft.com/en-us/power-bi/desktop-use-directquery

How I Built RAG for My Accounting App on Bedrock and pgvector

The first version of my accounting assistant could not find a single purchase of "comida" in a database full of lunches, misse...