80 Practical PowerPivot & DAX Formulas for Excel 2010
Well done, you have just written some MDX! The last button on the toolbar is for
Design mode. Clicking this button toggles you between graphical mode and text
mode where you can see the MDX. Please note that switching modes and making
changes will overwrite changes made in the other mode. The MDX generated is
perhaps overkill, so if you are new to MDX, don’t be intimidated by the syntax.
Click OK to exit the designer.
9. You are now back again in the Specify a MDX Query dialog of the Table Import
Wizard. Here you can give your query a friendly name—this will be the name
of the PowerPivot table. Click Validate to confirm that your syntax is valid, then
click Finish, followed by Close. Your PowerPivot table is showing a subset of
the cube data. You have converted multidimensional data into a flat, relational
format. If you place this table into a PowerPivot pivot table in Excel, you are
converting it back again into multidimensional data! We are going to extract
the two dimensions and the measures out of the table as separate dimensions
and measures. This raises a very important conceptual point. You are effectively
creating a subset of an SSAS cube; you are creating a data mart from a data
warehouse. By extracting from a few data marts (that is, PowerPivot tables from
a cube), you can reassemble the marts into a new richer model in a PowerPivot
pivot table in Excel. You are free to create your own BI, for you and your team,
outside of the constraints of a predefined SSAS cube. Further, you can combine
these data marts with data imported from relational sources—you can create your
very own BI model, which may well be different from your corporate SSAS cube.
This is the real beauty of PowerPivot—and this is why it’s often called self-service
BI, or personal BI, or instant BI. You have complete control and total flexibility,
without having to understand star schemas and SSAS cube design. That said,
there still remains a vital role for a centralized, enterprise-wide SSAS cube. Most
organizations need both “traditional” SSAS cube BI and PowerPivot “self-service”
BI. Before attempting the next step, you may want to right-click or double-click
on the column headers in the PowerPivot table and give each column a friendlier
name. Please note that the order of the columns may be different from your
query—this is not at all important, as you can add them in any order you want to
a pivot table.
10. On the Home ribbon in PowerPivot, click PivotTable in the Reports group and
choose PivotTable from the drop-down menu. In the Create PivotTable dialog,
accept the default of New Worksheet and click OK. The Create PivotTable dialog
is shown in Figure 3-18. You are switched into an Excel worksheet, with an empty
pivot table to the left and a PowerPivot Field List to the right.
11. In the PowerPivot Field List, drag the year to the Column Labels drop-zone.
Drag the category to the Row Labels drop-zone. In turn, drag Internet Sales
Amount, Reseller Sales Amount, and Total Sales to the Values drop-zone. Note
the numbers appearing in the pivot table and the aggregate functions shown in
the Values drop-zone. Are you wondering why all three aggregations are Count?
Right-click each entry in the Values drop-zone, and from the context menu,