Archive

Posts Tagged ‘PowerPivot’

Understanding the US Debt using PowerPivot

February 17th, 2011 2 comments

One of the major subjects that are talked about in the US is finance. One of those topics is the US debt. I got a mail today that someone published a book about the subject:

http://www.understandingtheusdebt.com/

So you think why do I blog about it ? Well he did all his research using PowerPivot (and you can actually download the workbook on the site )!.

A quote from his site:

The information presented in this book comes from public sources. Where possible, the data was pulled directly from the government agency (e.g., the Bureau of Public Debt, the Bureau of Labor Statistics, etc.) responsible for collecting and producing a given data set. The charts and tables were created in Excel 2010. I used a new Excel add-in, called PowerPivot (www.powerpivot.com), to

  • gather and store data from multiple sources
  • create relationships among different data sets
  • define custom calculations (e.g., last non-empty, yearly changes, etc.)
  • analyze the data using Excel PivotTables and PivotCharts

An Excel workbook, which contains much of the data I present in this book, is available below. If you want to dive further into a particular subject area, you’ll need to a copy of Office 2010 Professional (the PowerPivot add-in is free). I plan to post a brief tutorial for those who want to get more familiar with the data modeling and analysis techniques used in the workbook.  In the meantime, take a look at my August 2010 Article in SQL Server Magazine to learn more about PowerPivot (see the author page for a link).

Check out the entire page and the download link here: http://www.understandingtheusdebt.com/technology.aspx

Great example of a self sevice BI :)

Categories: Uncategorized Tags: ,

Wow how did you get that fancy PowerPivot window color ?

January 20th, 2011 1 comment

Today my colleague Julie Strauss showed me this neat trick to get this:

Or

This feature is in PowerPivot since the beginning. The PowerPivot windows gets his color from the color setting in Excel.

You can set it in Excel here:

Happy PowerPivot coloring :)

Categories: PowerPivot Tags: ,

Slowly changing dimensions and PowerPivot

January 6th, 2011 1 comment

I had a question about how to do Slowly changing dimensions in PowerPivot yesterday on my ask a questions page and decided to share two excellent solutions. First a quick refresher on what actually is a slowly changing dimension ? It probably is something we all came across one time or another but didn’t recognize it as such. Wikipedia gives a pretty good description:

Dimension is a term in data management and data warehousing that refers to logical groupings of data such as geographical location, customer information, or product information. Slowly Changing Dimensions (SCDs) are dimensions that have data that changes slowly, rather than changing on a time-based, regular schedule.

For example, you may have a dimension in your database that tracks the sales records of your company’s salespeople. Creating sales reports seems simple enough, until a salesperson is transferred from one regional office to another. How do you record such a change in your sales dimension?

You could sum or average the sales by salesperson, but if you use that to compare the performance of salesmen, that might give misleading information. If the salesperson that was transferred used to work in a hot market where sales were easy, and now works in a market where sales are infrequent, her totals will look much stronger than the other salespeople in her new region, even if they are just as good. Or you could create a second salesperson record and treat the transferred person as a new sales person, but that creates problems also.

There is more to it like different types and such which you can read all about in PowerPivot. I could make and example myself but there are two sources that already did it for me, one is Marco Russo and Alberto Ferrari’s book  PowerPivot for Excel 2010: Give Your Data Meaning (chapter 7) or see this other solution on this blog post: http://bennyaustin.wordpress.com/2010/08/08/powerpivot-dax-expression-for-type-2-scd-lookup/

So as you can see it is possible using PowerPivot, but you need a proficient amount of knowledge of DAX to pull it off.

Using the row context in PowerPivot DAX revisited

December 23rd, 2010 No comments

One of the most important things you need to know about PowerPivot and DAX is row and column context. Creating measures become a lot easier once you understand it.

Let  me give you an example of a problem that is not so hard once you understand row and column context. I had this question today on my blog:

I am trying to calculate Months Exposure for each model, i.e. how many months since the first Distributed Units
So if a product was first distributed on January 2009, MonthsExposure would be 24, etc.

and then he explained to me how he did this using excel:

This is how I calculate MonthsExposure in Excel:

MinDate ={MIN(IF(Model=”Nokia N8″,DateKey)}

MonthsExposure =DATEDIF(MinDate,TODAY(),”M”)

In PowerPivot this scenario is really easy to solve using the row and column context. I have created a previous blog post about what the Context is with PowerPivot you can check it out here: http://www.powerpivotblog.nl/what-is-that-powerpivot-pivottable-context-they-keep-talking-about

In short: when you work with a Pivottable and you put values on the x and or y ax this will mean the value that you put in the Values part automatically uses the value on that row and column to filter by. An example is this:

I put the sum of Onorderquantity in the Values list, it shows me the total sum, row and column context here is that there is no filter on each row, everything from the table is summed. Now let’s put Country on the Y ax:

Now what happens ? Each row is automatically filtered by the country that you see in the Row. Each row contains the sum of all the values of the field onorderquantity in the fact table for that specific country. Now what happens if you put year on the x ax:

Let’s take a look a what this means for the value in the red circled cell. This cell contains the sum of all the values of the field onorderquantity in the fact table for that specific country (China) for the year (2008). This means this is not just one value but is a set of values that is summed up to get one value. The measure makes sure we summarize it.

Back to the example of the question from my blog. He wanted to have the first date a specific product was sold. Remember that by putting the Products on rows we create a filter of all the rows by that product for the measure that we put in the values. The measure must be an aggregation, the filter returns a lot of rows.

In this case we want the first date a product ever was sold, This fact is captured in the field: FactInventory[DateKey].

Creating a measure with this field and putting it as a value in a pivottable that has Products on y ax (rows) will give a list of all the FactInventory[DateKey]‘s for this Product. We now have to make sure we use an function that returns only one value. In this case we want the first date. We can use this measure: FIRSTDATE(FactInventory[DateKey])

This returns the first date that a product was sold.

Expanding this measure to determine how many days this was exposed would be this: =ROUND(1. * NOW() – FIRSTDATE(FactInventory[DateKey]),0)

Resulting in:

I used the 1. * to calculate the difference in days read this blog post for more info: “How can I calculate difference between two dates in DAX (seconds, minutes, hours, days and months)”

I hope this blog post got you thinking about Row and filter context in PowerPivot. It really simplifies building measures if you understand it.

For more info about row and column context (and general DAX) you can watch this great webcast from Ashvini Sharma from the SSAS PM team :

Enriching Microsoft PowerPivot for Microsoft Excel Applications Using DAX (Data Analysis Expressions)

DAX (Data Analysis Expressions) is a new expression language for end users to add business logic to their PowerPivot applications. DAX offers a lot of power and flexibility while retaining the the simplicity and familiarity of Excel like formulas. This session explains the fundamentals and concepts behind DAX and demonstrates how to add business logic in PowerPivot using calculated columns and measures. This session also introduces you to various categories of DAX functions — scalar functions, table functions, aggregates, time intelligence — but is not intended to be a comprehensive overview.

View it here

Categories: PowerPivot Tags: , ,

Analysis Services – Roadmap for SQL Server “Denali” and Beyond

November 12th, 2010 No comments

There has been a lot of talk in MS BI land about the upcoming release of the SSAS team with Denali and what that means to UDM during the SQLPass convention this week and also in the blogsphere, most notably is the blog post by Chris Webb

T.K. Anand, Principal Lead PM from the team,  has made a blog post that answer the questions around what the roadmap is for SQL Server “Denali” and beyond, you can  read it right here.

If you have questions or comments please post them there. The MS BI team will be reading them.

Why use the PowerPivot Time intel golden rules? With examples

October 12th, 2010 1 comment

I have had a lot of question about time intelligent functions lately. Most folks ask me whether they really need to follow all the PowerPivot Time Intelligent Golden rules and what happens when they don’t.

In this blog I will show you what happens when you do not use all the rules, these are the rules you should take to hart:

  1. Never use the datetime column from the fact table in time functions.
  2. Always create a separate Time table.
  3. Make sure your datetime table has a continues date range
  4. Create relationships between fact tables and the Time table.
  5. Make sure that relationships are based on a datetime column (and NOT based on another artificial key column).
  6. The datetime column in the Time table should be at day granularity (without fractions of a day).

So here is what happens when you:

As you can see making sure all Time Intel. golden rules are met is a very good idea, otherwise you will get surprising results or DAX functions that will return no values.

Categories: PowerPivot Tags: , ,

Manage your PowerPivot datafeeds in a SharePoint datafeed library

October 6th, 2010 No comments

Now that PowerPivot is getting more and more known the IT departments are getting used to the idea they will need to publish data feeds to end users. But how can we do this ? How can we make one central location for this ?

In this blog post we are going to create a data feed on top of my SSAS cube and publish this feed to a central datafeed library.

Read more…

PowerPivot workshop in Amsterdam

September 30th, 2010 No comments

Marco Russo and Alberto Ferrari have announced a PowerPivot Workshop, a two days’ workshop that covers PowerPivot topics, starting from basic concepts and moving on up to complex data models and DAX formulas.

The workshop covers basic SharePoint configuration and usage. Although focused on PowerPivot integration, the workshop does not cover all the SharePoint topics that are needed to install a SharePoint server. This would need a complete course by itself and should be targeted to a more technical audience.

The main goal of the course is to facilitate the use of PowerPivot in the real world.
It is designed for professionals who want to use PowerPivot full capabilities while, at the same time, it permits to identify those scenarios where its use might not be convenient.

The course outline is the following:

  • Introduction to PowerPivot
  • Data loading techniques with different kind of sources: OLTP, DWH, Microsoft SQL Server, Microsoft Access and others
  • Data Modeling basics for building PowerPivot data models
  • Full coverage of the DAX programming language, with several hands-on examples
  • Calendar computation and data modeling best practices
  • Advanced data modeling techniques to solve some common scenarios
  • SharePoint integration

The workshop is held at the Microsoft Amsterdam location on December 1st and 2nd..  Check out: http://www.sqlbi.com/workshop/

Categories: PowerPivot Tags: