A Power BI Technique Mined from the Power Pivot Archives
Below, you will find one of our all-time favorite Power BI techniques. In the ten (yes ten) years we’ve been operating this site, we’ve written over 1,000 articles on Power BI. Hard to imagine - even for us - but true.
Years ago, we first wrote up this technique in the context of Power Pivot – Power BI’s cousin and predecessor, which we like to call “Power BI in Excel.”
Since the two products share the same brains (DAX and M), this technique is more relevant today than ever. Everything below is 100% legit for Power BI – the same data model “shape,” the same DAX, etc. – but now you can use it to power up your Power BI visuals, and not just PivotTables. Enjoy!
“If you don’t know me by now… you will never never never know me…”
In honor of PowerPivot v1’s public release, I thought I’d offer up my thoughts on my last six months working with the product.
Remember, I physically left Redmond in August and then officially left Microsoft in February, but have been putting PowerPivot through its paces that whole time, with a wide variety of data sets and business scenarios.
So in some sense, you can’t really get a closer view of PowerPivot than I have, while still maintaining any sense of neutrality about the product. So here it is, the honest truth…
It passed the Great Football Project Challenge
When I started the Great Football Project back in October, I really did not know what to expect. Honestly, I wasn’t sure that it was a great idea – was I going to get 5 days in and discover that PowerPivot simply wasn’t suited to that problem? There was genuine potential for embarrassment. But I needed something to blog about, and I was anxious to get started, so I just dove in.
After a few weeks, I was still holding my breath a bit. I was past the basics but hadn’t really pushed the envelope at all.
At some point though I just stopped wondering. It wasn’t until recently that I looked back and realized that I was building features, like the Rank measure, that were never in the original project at all.
I can say now with confidence that PowerPivot can absolutely handle the business logic phase of the football project, which the consultant back in 2006 described as one of the most complex cubes he’d ever seen.
I call that a success. Note how I specified the “business logic phase?” That brings me to the next topic…
It is NOT a data cleaner/shaper
OK, this is perhaps obvious since the PowerPivot tables cannot be edited, and there are no features/functions that let you reshape rows. Yes, you can add calc columns and that often does the trick, but there are other cases (like for instance, removing dupe rows) that PowerPivot can’t do at all.
The whole “shape it in normal Excel and then paste it over to PowerPivot window” workaround is ok for one-off work, or for tables that you don’t expect to change very often. But like many of you, I am striving to gain the benefits of automatic nightly data refresh that the server provides, and the Excel workaround doesn’t translate to that system at all.
So, even more than ever, you need a clean and properly-shaped data source to start with. So the first half of the work that the consultant did for the football project in 2006, where the text files were imported into SQL and turned into a decent schema, is still very much required.
For a production system, I don’t think this is a bad thing at all. It forces you to cooperate with IT (or whoever owns your databases) to give you what you need. And it forces them to listen to you more clearly, as long as they care about “taming the Excel beast” that is always their favorite thing to complain about 🙂
For a production system, that cooperation is essential for robust results. And if it’s not a production system, then yeah, the Excel shaping workaround is great.
“No, it can’t do that. Oh, wait. Nevermind. Yeah, it CAN do that.”
Having worked on the product from the beginning, I’m more closely familiar with its limitations than most people. In some ways that’s an advantage of course – I don’t dive into projects only to find out later that it can’t be done.
Oddly though, so far, knowing the limitations has largely just been a hindrance. Every time my initial answer was “no, not in PowerPivot v1,” I’ve turned out to be wrong.
I have succeeded using PowerPivot to solve every single real-life problem I’ve encountered in my first six months of using it.
Market basket analysis? Ranking measures? Standard deviation? Many to many relationship problems? Godawful horrible data sources? Measures that calc according to different formulas at different levels of the pivot? Iterating over variables that aren’t even in the view? PowerPivot has defeated them all. Well, more accurately, I have defeated them all with PowerPivot. It’s not like I sit back and watch PowerPivot do its thing. It is not always easy. Which brings me to the next point:
Challenging and Rewarding
You know those rare occasions where you suddenly find yourself in the fast lane? When your brain is forced to expand? When you are truly challenged, in a good way?
I’m talking about a specific kind of challenge, the good kind. Not the kind like when you take a new job and are overwhelmed by all the new rules and bureaucracy you have to learn. And not even the kind when you’re learning most new technologies (HTML and XML come to mind).
The best examples of this “positive challenge” vibe from my life are the ones where I’ve been pushed by a mentor. A couple of teachers come to mind. Some specific coworkers as well – Zeke Koch, David Gainer, and Amir Netz most prominently. Being around those guys everyday basically was a wakeup call – “Rob, you’ve been asleep. Wake up, it’s time to grow, to be excellent.”
PowerPivot, oddly, has felt like that. My brain has been expanding again, after a period of stagnation. More specifically, PowerPivot combined with the problems I’ve been tackling has done this.
And it flows over to other areas too. Example: years ago when I needed to estimate the incoming query load for the football stats project, I asked around for advice, got none, and then basically just guessed. It was a very hollow experience. Non-excellent.
Then recently, I was presented with essentially the same challenge. But this time, I didn’t guess, I modeled it: estimated how many reports (and queries per report) each user would exercise at peak, built a spreadsheet, re-taught myself the Poisson and Binomial functions, and voila – a “users per server” estimate I could believe.
I’m positive that working with PowerPivot is the difference between the “lazy guess” mentality from before and the “it can be done” mentality today. I love it 🙂
Carrot, not stick (but sometimes the carrot is too big for one sitting)
I don’t want you to interpret the above as “PowerPivot is a harsh Pai Mei figure, kicking Rob’s ass day in, day out.”
Nope, I worked with PowerPivot for months, and did things I thought were pretty damn cool, without ever stretching my brain the way I have been lately. If you’re an Excel pro, you will find PowerPivot to be a very welcoming environment.
Excel veterans: you will never be forced to do anything uncomfortable with PowerPivot.
In fact you will do amazing things in your first week that will actually deliver greater results than standalone Excel, and it will actually seem easier than normal Excel. Check out the CALCULATE function and you will see what I mean.
But boy, sooner or later, it will TEMPT you to try something bigger.
You’ll be sitting there one day thinking, “Gee, I sure wish I could build an analysis that showed X.” And then something hits you – “hey wait, I bet THAT’s what that function I looked at the other day does” or “Didn’t I see a blog post last month about something similar?”
Two hours later, you’re still heads-down over your DAX formulas and relationships, feeling like you’re 30 seconds away from a breakthrough that will change your professional life.
You might not even succeed that first day. You may have to come back tomorrow with a fresh perspective and a clear head.
And you love it. Every minute of it.
But that’s when you realize that you have left the reservation. You are not in Kansas anymore. Time to take off the training wheels. Pick your analogy. Make no mistake – the power of DAX in particular can challenge you immensely. Jon Udell described the examples I’ve covered here on the blog as “magic,” and he’s right – you won’t pick up everything overnight. You should be prepared for that.
It’s called learning. And you’ve almost forgotten what that feels like. It’s what drew you to Excel in the first place, years ago – that fleeting glimpse of capabilities and the results it could deliver, but also frankly because you were hooked, addicted, to mastering it.
That feeling is back 🙂