Power BI: Measures Vs Calculated Column

In earlier blogs, we have understood various jargons in Power BI. To add to these jargons further,  there is concept called Measures in Power BI. Generally this term gets confused with calculated columns.

Let us see what Measures is all about and if it is really an alternative to Calculated columns. Actually its not!! 

We have seen how to add calculated column in earlier blogs such as Win_by_Runs. Here we wanted to know the number of runs by which the match was won, and it was for every match. Hence the calculation was for row wise and result is shown row wise. 

In short, Calculated columns use the context of the row and provide calculation row wise. Hence whenever we need any such calculation at row level, we have to use the calculated column. 

On the other side, if we need any calculation as aggregation of the entire data or based on any filter, we have to use Measures. In our IPL data, if we want to see total runs for all matches, we need this as aggregation of values of one column and all rows. This can be achieved by Measures. 

Let us go back to our IPL example again to see how it works. If we want to know total runs scored. Below are the steps to create the Measure. 

Navigate to Modelling tab, Select the table in which you want to add the measure and click on New Measure as shown in below snippet.

Measure1

By default the Measure 1 will be the name for this Measure, depending on how many measures we have already added in this. Here I already have few measures created, hence its showing Measure 3 as shown in below snippet.

Measure2

Let us change the name and add the formula as shown in below snippet. 

Measure3

Here we have to understand that, unlike the columns, Measure will not be seen as a column in the table, and will be available only as formula to be calculated at runtime.

Hence we won’t be able to see the result of this formula now.

Measure4

If we want to see the output of this measure, we need to add this to Report and can see the value. Either we can directly drag this measure to report and see the bar chart by default or add a card visual and then select the measure as field. This will calculate the value of the measure and display on the visual.

Measure5

We can also add filters to the measures. If we want to see the total runs scored in Mumbai location, we can write use the formula as Calculate and add filter using match formula as shown in below snippet.Measure7

If we see the output of this filtered measure, we can see total runs scored in Mumbai as shown in below snippet.

Measure6

Summing up the Measures vs Calculated Columns comparison considering three parameters

  • Memory utilization:
    • Calculated column is stored in the in memory of the database and it will consume the memory even if nobody is querying this column. However while user interacts with reports, there is no impact on user’s virtual memory utilization
    • Measures is always calculated at run time, it actually impacts the virtual memory, however it saves in memory of the database.  Hence one should be careful while adding measures in the Power BI
  • Evaluation Context: 
    • Calculated column to be used when calculation is in row context 
    • Measures to be used when aggregation is expected from multiple rows
  • Visibility
    • Calculated columns’ output is visible in the table as soon as they are created 
    • Measures’ output is not visible until we add it to the report in terms of visual

Thank you for reading my blog, if you have any questions please mention in the comments and hit the like / share button if you like my article.

Keep Learning !! Happy analyzing and be Powerful 🙂

Continue reading “Power BI: Measures Vs Calculated Column”

Power BI: IPL Analytics- Dashboard

In my earlier blogs, we have seen how to develop Reports using Power BI desktop. Let us use these reports, publish those in Power BI service  and create Power BI dashboards.

Once we have detailed reports available in Power BI desktop, we can publish those in Power BI service.  As we have seen in earlier post of deployment models, if we want to share the Power BI report, publishing the report to Power BI service is one of the options.

Open the report in Power BI desktop and go to Files, select Publish, this will give an option to Publish to Power BI. Once we click on this, it opens a window and asks for credentials to connect to the Power BI subscription. Once we  enter the credentials, it connects and asks if report to be deployed to which workspace. Select the workspace, or default my workspace would be selected.

PublishtoPowerBI

Once we publish the report , we get success message. We can open this report either directly from here by clicking on the link as shown in the below snippet or by going to workspace and locating the report to open.

PublishtoPowerBI2

Now let us see how Power BI Service UI looks like and what features it provides. As soon as we open the Power BI Service, it shows below UI. If you see on left hand side menu, various options are displayed. PublishtoPowerBI3

PublishtoPowerBI4

At the bottom we can see Workspace, which has default My Workspace. Once we click on My Workspace, we can see all components of the workspace such as dashboards, Reports , workbooks and DataSets. In the below snippet, under reports section we can see recently published report. We can open that report.PublishtoPowerBI5

Report would be displayed as shown below. Here we can edit report, however we neither do any ETL activity nor any DAX calculations. We can edit the  report in terms of visuals, ask questions and add additional visuals etc. You can click on Edit report and start editing the report.

I would recommend that one should go though various options available in the menu and explore the components as shown in below snippet.

PublishtoPowerBI8

PublishtoPowerBI9

 

 

 

Let us create a dashboard in Power BI. We already have reports developed in Power BI, As we think of Dashboard, we think of some important information which should highlighted. Hence few information from the report would be pinned to dashboard. As shown in below snippet, for every visual in the report, there would be a pin icon shown at the top left side. e.g. click on the pin icon of Overs Bowled visual.PublishtoPowerBI10

As we click on this pin icon, it will give below screen asking if it is to be pinned to existing dashboard if any dashboard is already created, or to a new dashboard. we can decide as per our requirement.

PublishtoPowerBI11

I am selecting new dashboard and naming it as IPL Dashboard as shown in below snippet and click on the Pin button.PublishtoPowerBI12Power BI would create the new dashboard and pin this visual to the dashboard. We can directly navigate to the  dashboard from Go To Dashboard button as shown in below snippet or can even create phone view of the dashboard.

PublishtoPowerBI13

Visuals which are pinned to the dashboard are called Tiles in dashboards. for  each tile , can take below actions by clicking on the three dots at top right of the tile . If we click on the tile from the dashboard, it would navigate to the report. We can try to explore what every action does and meant for.

PublishtoPowerBI14

We can also view the mobile view of the dashboard as shown in below snippet

PhoneView1

In this blog we have understood about the Power BI service and how create dashboard from Power BI report.

Thank you for reading my blog, if you have any questions please mention in the comments and hit the like button if you like what I am writing.

Keep Learning !! Happy analyzing and be Powerful 🙂

Continue reading “Power BI: IPL Analytics- Dashboard”