PASS Attack!

It’s Friday. Tomorrow I present two sessions at SQL Saturday #238 – Minnesota. Then I take off for PASS Summit 2013 on Sunday. I then wrap up the week at SQL Saturday #237 – Charlotte BI Edition.

I hope to see a variety of you at these different events.

If you come to SQL Saturday 238, you will find me in two sessions to kick off the day followed by time at the Magenic or PASS booths. I am presenting on Power BI and Tabular Models. If all goes well, my son will be joining me. He is a bit taller …

Next up is this years Summit. While I am not speaking at this event, I will be participating in the Community Zone as well as many of the volunteer meetings on Tuesday. If you are a user group leader, SQL Saturday leader, or other volunteer, be sure to connect with other volunteers to share ideas and generally grow the SQL Server community.

Finally, I will be at the SQL Saturday event in Charlotte. At this event, I will be presenting on Using Power Pivot to Drive Quality into ETL Processes. I am excited about this session as we used this method on a project with great success. This is just another great way to use Power Pivot to improve your development processes. You will likely be able to find me at the PASS booth during some of the day as well.

I hope PASS Attacks are deadly. But it should be fun and memorable. I look forward to seeing you all there.

Adding Top 10 Charts to Power View Which Honor Filters

Before I get too far in the weeds, I have to recognize Rob Collie, his blog (http://www.powerpivotpro.com) and his book DAX Formulas for PowerPivot: The Excel Pro’s Guide to Mastering DAX. His book has been a great resource as I work through fun with DAX. I used information from his post on Dynamic TopN Reports via Slicers, Part 2 to solve my problem which I will describe next.  Thanks for the info Rob!


The problem I was trying to solve was creating a top 10 chart in Power View that showed the top 10 in context of what was filtered in the Power View report. If you click a pie slice in a chart, filter the top 10 at the same time. Also have it work with slicers. I was working with Power View and a couple other BI tools to see if this was possible. All tools are able to handle creating a calculation that will show the top 10 for a set of criteria, however, when the data was dynamically filtered on the page, only top 10 values that from the original measure that also worked in the filter worked.  So, now my top 10 charts would have fewer than 10 results.

I will walk through the process so you can see both ways and how I got to the eventual solution.

Both solutions use the RANKX function in Power Pivot. So let’s start their. I am using my Poll solution from the My Vote application built for Modern Apps Live. We have a Poll Response Count calculated measure:

Poll Response Count:=COUNTA([PollResponseID])

Using that as the starting measure we add the ability to get the top 10 responses by Poll. On the Poll table, which is joined to the Poll Response table by Poll ID, I added the following calculation to give rank values to the Polls.

Poll Response Rank:=RANKX(ALL(‘Poll’),[Poll Response Count])

This applies a rank value in ascending order to the Polls by Response Count.  Let’s apply this to a Power View report. In my report, I will be adding a Slicer on Category Name (all Polls belong to a Category), a bar chart with Response Count by Poll Question, a Pie Chart with Response Count by Category, and a table which shows the raw rank value for each question. Here is what that looks like:

image

In order to get the top responses in the bar chart we need to add Poll Response Rank to the Chart Filter (Not the view filter) for the bar chart. As you can see below, we pick the responses less than or equal to ten.

image

This applies the top 10 filter only to the chart which is what we want. However, when I filter by Off-Topic only two values remain in the chart. When you look at the table values ranked less than 10 overall will not be included in the chart. In some cases this is exactly the functionality you want. Here is what the filtered view looks like, only two of the 4 show up in the bar chart.

image

What if I wanted the slicer to also apply to the bar chart. We need to use a slightly different formula.

Poll Response Filtered Rank:=RANKX(ALLSELECTED(‘Poll’),[Poll Response Count])

By changing the chart filter to the new rank value you will see we get the filter applied based on the selections in the sheet.

image

How Does It Work?

The key is what I learned from Rob’s writings and samples. The ALL() function removes external context when applying a function. So ALL in this case will return the full set of Polls and then apply the RANKX function. So, it is returning the rank for all polls. ALLSELECTED() applies the RANKX function to the currently selected values. So any operation within a Power View sheet which changes the filter context, such as a slicer, will reset the Polls to only the set of Polls which have been selected and then apply the ranking.

If you do not use ALL or ALLSELECTED, the context is the row and will always return 1. Which is not helpful.

Can We Reverse the Order?

If you need to show the bottom ranking, you can add to the RANKX function. RANKX syntax:

RANKX(<table>,<expression>[,<value> [,<order>] [, <ties>]]])

Value, Order, and Ties are optional parameters. The one that matters is the Order parameter. The Order can be 0 or 1 and it defaults to 0. 0 ranks the values in descending order. To get the bottom result, you would use 1 here. The following code shows how we would rank the bottom polls.

Poll Response Filtered Rank:=RANKX(ALLSELECTED(‘Poll’),[Poll Response Count],,1)

For the optional parameters, you only need to leave a placeholder if you do not need it. Why create a separate value for reverse order? Because Power View can easily handle less than 10, but not the last 10. By making the change above and not changing our standard rank you can see that the data is now filtering for the bottom ten based on how the ranking value is assigned.

image

I hope this helps you create even more effective visualizations with just a bit more DAX under your belt.

The Changing World of BI, A New White Paper for Magenic

MagenicLogo2012x70tallIn the ever changing landscape that is Business Intelligence (or is that Business Analytics?), a fellow business analyst from Magenic, Chuck Whittemore (B), and I authored a white paper based on our experiences over the past months.

What I think makes our work unique, a BI architect and a business analyst came together to show our worlds colliding in the age of modern BI tools.  While the goal has always been to bring the data to the users and let them work with it as creatively as possible, the tools to do this were IT focused.  What we see now is that with the advent of in-memory, client-side BI tools, users are now able to get to this on their own.  Microsoft has invested heavily in Excel to make it a first-class BI tool.  Our paper discusses this disruptive nature of the new tools and how Excel is being pushed to the next level.  After all, Excel is everywhere already.

Enjoy the read and I welcome your feedback.

The Changing World of Business Intelligence: Leading with Microsoft Excel

Exploring Excel 2013 as Microsoft’s Business Intelligence Client

Excel 2013 LogoA little over six months ago, I wrote an article on Magenic.com about Excel 2013’s Impact for BI Users.  This coincided with the Office 2013 Preview release.  I discussed the addition of Power View and PowerPivot into the product.   Last week, I followed that article up with another on the fact that Excel appears to be Microsoft’s BI client platform now and into the future.

It appears that I am not alone in this assessment.  Michael Koploy of Software Advice, a company that reviews BI software, did a Q&A session with Rob Collie, a.k.a. PowerPivotPro ( T | B ), where Rob came to some similar conclusions.  He notes that “the powerpivotprotoday[1]inclusion of PowerPivot in 2013 is a major inflection point” for users to implement BI in Excel more fully.  I really like his take on the relationship between BI specialists and IT pros and the end users of Excel.  Microsoft has been pushing a concept of BI for the masses and ironically today’s Excel is the helping this happen.  Check out the rest of the Q&A about whether Excel is the next great BI tool for more insights from Rob.

As I start to deliver more solutions with customers using Excel, SharePoint and soon Office365, I am going to kick off a new series here on my blog – Excel 2013 BI Tips.  My goal is to document XLTipsthose tips, tricks and discoveries from my journey with the new Excel.  Some of them may be seem common, but I just don’t want to forget so I will be noting them as well.  Join me for this interesting journey through Excel and BI.

Excel 2013 Will Impact BI Users

Excel 2013 IconAs noted in that great text, The Hitchhiker’s Guide to the Galaxy, “Don’t panic!” Excel 2013 will make even more capabilities available to BI users.  This includes having xVelocity natively supported in the tool which makes much of the PowerPivot capabilities available in a spreadsheet which used to only be available in the PowerPivot window.  It also adds the ability to create Power View reports in Excel.

Check out more on my thoughts about this on Magenic’c blog.