Data Model, Development Tips, Excel, How To, PowerPivot, Report

Add a relationship using Diagram View in Power Pivot

Open the Workbook which we prepared in the last exercise in our previous post.

Add Excel Sheet/Table to the PowerPivot Data Model

  • In the Power Pivot window, in the View section, click Diagram View.
  • Use the slide bar to resize the diagram so that you can see all objects in the diagram. Rearrange the tables by dragging their title bar, so they’re visible and positioned next to one another. Notice that all tables are unrelated to each other, we will create relationship among these tables.

After adding relationship the Diagram will Look as below.

ExcelData-6

  • Let start creating the relationship.
  • Sports->SportID click and drag to Disciplines->SportID and release. You will see the relation is built between these two tables on SportID.

Similarly follow to create other relations too as shown in below image.
ExcelData-5

You notice that both the Medals table and the Events table have a field called DisciplineEvent. Upon further inspection, you determine that the DisciplineEvent field in the Events table consists of unique, non-repeated values.

The DisciplineEvent field represents a unique combination of each Discipline and Event. In the Medals table, however, the DisciplineEvent field repeats many times. That makes sense, because each Discipline+Event combination results in three awarded medals (gold, silver, bronze), which are awarded for each Olympics Edition the Event is held. So the relationship between those tables is one (one unique Discipline+Event entry in the Disciplines table) to many (multiple entries for each Discipline+Event value).

  • Create a relationship between the Medals table and the Events table. While in Diagram View, drag the DisciplineEvent field from the Events table to the DisciplineEvent field in Medals. A line appears between them, indicating a relationship has been established.
  • Click the line that connects Events and Medals. The highlighted fields define the relationship, as shown in the above screen.
  • To connect Hosts to the Data Model, we need a field with values that uniquely identify each row in the Hosts table. Then we can search our Data Model to see if that same data exists in another table. Looking in Diagram View doesn’t allow us to do this. With Hosts selected, switch back to Data View.
  • After examining the columns, we realize that Hosts doesn’t have a column of unique values. (Assume EditionID Field is not available in the Host & Medal Table, in my case I have already added this Field in my workbook I shared). In such case we’ll have to create it using a calculated column, and Data Analysis Expressions (DAX).

It’s nice when the data in your Data Model has all the fields necessary to create relationships, and mash up data to visualize in Power View or PivotTables. But tables aren’t always so cooperative, so the next post will describe how to create a new column, using DAX that can be used to create a relationship between tables.

We will see how to work with calculated fields in our next upcoming post.

Data Model, Development Tips, Excel, How To, PowerPivot, Report

Add Excel Sheet/Table to the PowerPivot Data Model

Download the Excel file from the link provided in previous post.

Import data using copy and paste from Excel sheet or other source for PowerPivot Data Model.

Open the Workbook:

ExcelData-3

Select sheet one by one and Add to Data model of PowerPivot.

ExcelData-4

Make sure all Table/Sheet is added to Data Model of PowerPivot.

I have create a sample Excel File for you which you can down load from the Shared Path using link: http://1drv.ms/1GpZFd4

This file have couple of sheets having data related to Olympics which I have compiled from MS Office support site.

You can find the link on the Menu of my blogsite too to access the shared files.

I will be using this file for couple of walkthrough in my upcoming posts.

Data Model, Development Tips, Excel, PowerPivot

Import data using copy and paste from Excel sheet or other source for PowerPivot Data Model.

You can copy & Paste data from an Excel workbook, or import data from a table on a web page, or any other source from which we can copy and paste into Excel. In the following steps, you add the data from a table.

  • Insert a new Excel worksheet, and give it the name desired any meaningful name that describes the data.
  • Select and copy the data, including the table headers.
  • In Excel, place your cursor in cell A1 of the above created worksheet and paste the data.
  • Format the data as a table. You press Ctrl + T to format the data as a table, or from HOME > Format as Table. Since the data has headers, select My table has headers in the Create Table window that appears.

ExcelData-1

  • Name the table. In TABLE TOOLS > DESIGN > Properties locate the Table Name field, and type desired name.

ExcelData-2

  • Format your data using Excel std. formatting tool.
  • Save the workbook.This file have couple of sheets having data related to Olympics which I have compiled from MS Office support site.
  • You can find the link on the Menu of my blogsite too to access the shared files.
  • I have create a sample Excel File for you which you can down load from the Shared Path using link: http://1drv.ms/1GpZFd4

I will be using this file for couple of walkthrough in my upcoming posts.

Development Tips, Excel, How To, Power View, PowerPivot, Report

Power View in Excel 2013

Power View is an interactive data exploration, visualization, and presentation experience that encourages intuitive ad-hoc reporting.

Power View is a feature of Microsoft Excel 2013, and of Microsoft SharePoint Server 2010 and 2013 as part of the SQL Server 2012 Service Pack 1 Reporting Services Add-in for Microsoft SharePoint Server Enterprise Edition.

Power View has these features, as part of Power BI for Office 365:

  • Create Power View sheets in Excel and then view them in the Power BI Windows Store app.
  • View Power View in Excel sheets in your browser, without installing Silverlight.

Data sources for Power View

In Excel 2013, you can use data right in Excel as the basis for Power View in Excel and SharePoint.

When you add tables and create relationships between them, Excel is creating a Data Model behind the scenes.

A data model is a collection of tables and their relationships reflecting the real-world relationships between business functions and processes—for example, how Products relates to Inventory and Sales.

You can continue modifying and enhancing that same data model in Power Pivot in Excel, to make a more sophisticated data model for Power View reports.

With Power View you can interact with data:

  • In the same Excel workbook as the Power View sheet.
  • In data models in Excel workbooks published in a Power Pivot Gallery.
  • In tabular models deployed to SQL Server 2012 Analysis Services (SSAS) instances.
  • In multidimensional models on an SSAS server (if you’re using Power View in SharePoint Server).

Recall from my previous post Creating My First Report using PowerPivot, I will be using same Data Model to demonstrate the feature of Power View, also same report in different format.

Let’s design Customer wise Sales Report using Power View.
PowerView-1

I am using the same Workbook which we used for PowerPivot creating Matrix report for Item Vs Customer Sales.

From Insert Tab choose Power View Reports in ribbon.

Remember this workbook already having Data Model with tables Customer, Item, Cust. Ledger Entry & Item Ledger Entry. One which we created during our previous exercise during walkthrough of PowerPivot.

We already have Relationship defined between Customer & Item Ledger Entry (No. -> Source No.), also Item & Item Ledger Entry (No. -> Item No.).
PowerView-2

You can View the Relationship using Relationship from Ribbon Power View Tab.

Once the Power View Sheet is inserted the Power View Tab will be Visible.

This will list the two relations which we created earlier in previous exercise post.

However we will be requiring one more relationship for this report. Add using New button on Manage Relationship window.

Enter the Relation for Customer & Cust. Ledger Entry (No. -> Customer No.).

You can see all the 4 tables are listed in Field List Pane.
PowerView-3
Arrange the Fields from respective tables as shown in above screenshot.
PowerView-4
Arrange the fields as shown in above screenshot.

Design of your report should be similar to one shown in below screenshot.
PowerView-5

Resize the Table area to fit the area and the way you want to represent the data.

When a Customer is selected in Title Area, below two tables show the Item Sales Quantity & Total Value for the selected Customer.

You can add fields in the Filter Pane to slice the data accordingly.

I will come up with more details in my upcoming posts.

Till then stay tuned and keep practicing.

Development Tips, Excel, How To, PowerPivot, Report

Add Slicers to PivotTables in PowerPivot

Recall from my earlier post Creating My First Report using PowerPivot in which we created a Items Vs Customer Sales matrix report.

I am going to use same report to demonstrate how we can add slicer to this report.

Slicers are one-click filtering controls that narrow the portion of a data set shown in PivotTables and PivotCharts. Slicers can be used in both Microsoft Excel workbooks and PowerPivot workbooks, to interactively filter and analyze data.
PowerPivot-30

Open the report we created in our previous post.

From Insert Tab select Slicer in the ribbon.
PowerPivot-31

Choose the source Connection/Data model and respond Open.

Select the Customer Table.

Select the Country/Region Code field and OK.
PowerPivot-32

A Slicer will be added to the sheet.

Re-size to fit and drag the Slicer to position at desired location on sheet.

You can give desired Caption to your Slicer by editing the Slicer Caption.

Most important is to select the pivot table on which this Slicer will operate.

Select Report Connection, and from preceding window select the PivotTable.
PowerPivot-33
Above is the screenshot with applied filter on Country/Region Code = DE.

Stay tuned to know more options, I will come up with more details in my upcoming posts.

Till then keep practicing.

Excel, PowerPivot

Basics of Power Pivot for Excel – 2013

Dear friends, I have published couple of posts on this topic. I will be adding more advanced features and details related to this in my upcoming posts.

For your ready reference below I present Links to those posts.

PowerPivot for Excel

Start the Power Pivot in Microsoft Excel add-in

Troubleshooting: Power Pivot Ribbon Disappears

PowerPivot Creating a Data Model in Excel 2013

Adding more tables to the Data Model using Existing Connection – In PowerPivot

Add relationships to Data Model in PowerPivot

How to add Filter for data retrieval in PowerPivot Data model.

Create a calculated column in PowerPivot

Creating My First Report using PowerPivot

In Excel 2013, PowerPivot and Power View are no longer separate add-ins that need to be downloaded and installed. These add-ins are natively included.

PowerPivot in Excel 2013 is functionally very similar to the PowerPivot add-in for Excel 2010.

PowerPivot is an add-in that lets end users gather, store, model, and analyze large amounts of data in Excel. Power View provides intuitive data visualization of PowerPivot models and SQL Server Analysis Services (SSAS) tabular mode databases.

If you’re unfamiliar with either PowerPivot or Power View, I encourage you to first review my previous post links provided above to understand the basics.

Some parts of the PowerPivot architecture is embedded inside of Excel 2013.

  • The PowerPivot version in Excel 2013 no longer uses a separate PowerPivot Fields list. Instead, the built-in PivotTable Fields list is used. This means that some capabilities from the Excel 2010 add-in (e.g., searching for fields by name, creation of slicers from the field list, surfacing of column descriptions when hovering over a field) are no longer available.
  • Workbooks with PowerPivot models are no longer limited to 2GB in size in Excel 2013. However, the 2GB limit still applies to workbooks that will be published to SharePoint.
  • In Excel 2013, a refresh of a PivotTable or PivotChart will, by default, initiate a refresh of the underlying data connections in the Data Model. This is very different from Excel 2010, where a PivotTable refresh only re-queries the model. The new refresh behaviour can be changed by clicking Connections on the Data tab, selecting Properties, and clearing the Refresh this connection on Refresh All check box.
  • Stay tuned for more information on this topic. Till then keep practicing & exploring.
  • In Excel 2013, a Power View “report” is a worksheet rather than an .rdlx file. There’s no concept of multiple report views. Instead, multiple Power View worksheets can be created within a single Excel workbook.

Stay tuned for more information on this topic. Till then keep practicing & exploring.

Development Tips, Excel, How To, PowerPivot

Troubleshooting: Power Pivot Ribbon Disappears

In rare cases, the Power Pivot ribbon will disappear from the menu if Excel determines that the add-in is destabilizing to Excel. This might occur if Excel closes unexpectedly while the Power Pivot window is open. To restore the Power Pivot menu, do the following:

  • Go to File > Options > Add-Ins.

In the Manage box, click Disabled Items > Go
PowerPivot-29

  • Select Microsoft Office Power Pivot in Microsoft Excel 2013 and then click Enable.

If the previous steps do not restore the Power Pivot ribbon, or if the ribbon disappears when you close and reopen Excel, try the following:

  • Close Excel.
  • Point to Start > Run and then type regedit.
  • In Registry Editor, expand HKEY_CURRENT_USER > Software > Microsoft > Office > 15.0 > User Settings.
  • Right-click PowerPivotExcelAddin and then click Delete.
  • Scroll back up to the top of Registry Editor.
  • Expand HKEY_CURRENT_USER > Software > Microsoft > Office > Excel > Addins.
  • Right-click PowerPivotExcelClientAddIn.NativeEntry.1 and then click Delete.
  • Close Registry Editor.
  • Open Excel.
  • Enable the add-in using the steps at the top of this article.
Development Tips, Excel, How To, PowerPivot

Start the Power Pivot in Microsoft Excel add-in

Power Pivot in Microsoft Excel 2013 is an add-in you can use to perform powerful data analysis in Excel. The add-in is built into Excel, but by default, it’s not enabled. Here’s how you enable Power Pivot before using it for the first time.

  • Go to File > Options > Add-Ins.

In the Manage box, click COM Add-ins> Go
PowerPivot-26

  • Check the Microsoft Office Power Pivot in Microsoft Excel 2013 box, and then click OK. If you have other versions of the Power Pivot add-in installed, those versions are also listed in the COM Add-ins list. Be sure to select the Power Pivot add-in for Excel.

PowerPivot-27
The ribbon now has a Power Pivot tab
PowerPivot-28

Development Tips, Excel, How To, Office Integration, PowerPivot, Report

Creating My First Report using PowerPivot

In my earlier posts we have created the Data model for Analysis.

If you missed them you can follow below links to refresh all information.

PowerPivot for Excel

PowerPivot Creating a Data Model in Excel 2013

Adding more tables to the Data Model using Existing Connection – In PowerPivot

Add relationships to Data Model in PowerPivot

How to add Filter for data retrieval in PowerPivot Data model.

Create a calculated column in PowerPivot

We have learned basic actions, let’s create our first Report.

I will be creating Pivot Matrix Customer Vs Item Sales.

Open the Excel in which we created our Data model and imported our table data.
PowerPivot-21
Select PivotTable From Ribbon under Home Tab.
PowerPivot-22

Select New Worksheet or Existing Worksheet as per the case.
PowerPivot-23
You will see a Pivot is inserted, in right side you will find all the tables available in the Data model of this Worksheet.
PowerPivot-24

Design the Pivot as above screenshot.
The output of this report will be as below if executed without Date Filter.
PowerPivot-25
I will come up with more details and features of PowerPivot in my upcoming posts. Till then keep practicing and stay tuned for more details on this topic.

Development Tips, Excel, How To, Office Integration, PowerPivot, Report

Create a calculated column in PowerPivot

If you have missed earlier post, please walkthrough them for better understanding from below links:

PowerPivot for Excel

PowerPivot Creating a Data Model in Excel 2013

Adding more tables to the Data Model using Existing Connection – In PowerPivot

Add relationships to Data Model in PowerPivot

How to add Filter for data retrieval in PowerPivot Data model.

In Power Pivot, you can use Data Analysis Expressions (DAX) to add calculations. In this task, I will add simple Excel Formula =ABS (Quantity) in Item Ledger Entry Sheet. You can add formulas either simple calculation from two fields or referencing from other tables and sheet. I will come with more details on this in separate post.

  • In the Power Pivot window, switch to Data View.
  • Select the Item Ledger Entry table/ sheet.
  • Click Design > Add.

PowerPivot-18

Alternatively you can Add by selecting Column, Right Click and choose Insert Column as you do in Excel.

New Column Will be Added.

  • In the formula bar above the table, type the following formula. AutoComplete helps you type the fully qualified names of columns and tables, and lists the functions that are available. You can also just click the column and Power Pivot adds the column name to the formula.

In my case it is =abs([Quantity])

  • When you have finished building the formula, press Enter to accept the formula.

Values are populated for all the rows in the calculated column. If you scroll down through the table, you will see that rows can have different values for this column, based on the data that is in each row.

Rename the column by right-clicking and selecting Rename Column.
PowerPivot-19

  • Type Sales Quantity, and then press Enter.

Below is the Screen after populating the value post formula application to Calculated Column.
PowerPivot-20

I will come up with more details in my upcoming post, Till then keep practicing and stay tuned for more details and updates on this topic.