Pareto Analysis the Easy Way

May 16, 2013

 
image

“Computer?  Tell me how many products account for the top half of all sales?”

The scene in Star Trek IV where Scotty picks up the mouse and tries to instruct the computer by speaking into it was, in my opinion, the lone bright spot in an otherwise lackluster movie.  We all feel the same way sometimes of course.  We just want to say “hey computer can you just do what I want without making me trick you into doing it?” 

(Related:  I had a professor once who liked to say “as computer scientists we are trained to communicate with the dumbest things in the world – computers – so you’d think we’d be able to communicate quite well with people.”  He also writes a science and politics blog and was one of my favorite professors.)

OK, so how do we build something like this in PowerPivot:

image

The Handful of Products Shown Account for 50% of All Sales – But How Did I Build This?

First, Don’t Make it Harder Than It Is!

Read the rest of this entry »


Adding a Minimum Threshold Slicer to “Stores That went negative” Technique

April 30, 2013

 
Thursday’s Post “Fixed” The Number of Negative Stores for a Month at 8.  Now We Vary That Threshold That With a Slicer.  PowerPivot is Amazing :)

Thursday’s Post “Fixed” The Number of Negative Stores for a Month at 8.
Now We Vary That Threshold That With a Slicer.

Let’s take Thursday’s post and extend it a bit.

In the picture above you’ll see that I have 5 selected as my threshold on the new slicer, and 48 months “qualify” for that threshold – there are 48 months where at least 5 stores were negative.

Now let me select 9 on the threshold slicer:

Raising the Threshold to 9 Weeds Out 10 More Months, Only 38 Months Exhibited 9+ Negative Stores.  Did i mention that PowerPivot Rocks? :)

Raising the Threshold to 9 Weeds Out 10 More Months, Only 38 Months Exhibited 9+ Negative Stores

How’d I Do This?

Read the rest of this entry »


Showing Only Months/Weeks/Etc. When at Least N Stores Showed a Certain Behavior

April 25, 2013

 
image

Nice Pivot, But I Only Want to See Months Where Eight
or More of My Stores Went Negative!

***Update:  Technique Extended, Workbook available

In a followup post I have added a slicer that lets the report user control the minimum number of stores required, rather than fixing it at 8 like this post does.  Also, the workbook is now available for download.

Find both in the followup post, located here.

Tales from Remote Consulting

Awhile back I left my job to start a new company.  I’m not yet ready to announce what that new company is about – I’m working hard on that and you folks will be the first to know.  Spoiler:  it’s about PowerPivot and Excel.

But in addition to hard work, there’s also a lot of waiting involved in all of that.  I’ve been filling the gaps with training and remote consulting to keep my head in the PowerPivot game.

Remote consulting in particular is a lot of fun – people send me a workbook, I spend 1-3 hours and build what they want, then send it back.  Gives me a good sampling of the problems that are “out there.”

One of those remote consulting jobs featured the problem pictured above (except that they had real data, and what I’m showing is 100% fake).

How Many Stores Fell Below Zero Each Month?

Read the rest of this entry »


Guest Post Continued From Tuesday: Now With USERELATIONSHIP

April 11, 2013

Note from Rob

Post is late today NOT because of Chris, but because of me.  Chris had this to me last week in fact, so don’t go thinking that he was slow or something Smile

I am particularly interested in this post because I have personally not yet used USERELATIONSHIP() yet.  OK, take it away Chris…

I couldn’t stop there…

I was feeling pretty good with the result from Tuesday…I helped my customer out. I got a new DAX tool for my toolbox. Life was good. But then I got thinking, “But what if they want to know how many promotions started or ended in May?” “I need that relationship back!”

To tackle this, I created two relationships between DimDate and DimPromotion. One on the StartDate of DimPromotion and one on the EndDate. The key to doing this without breaking my previous measure was to make these relationships inactive.

clip_image016

Read the rest of this entry »


Named Sets and “Asymmetric” Pivots: Showing Different Measures for Different Years

April 4, 2013

 
Riddle me this:  how do we take the first pivot below, and turn it into the second pivot?

PowerPivot Named Sets:  Original Pivot

This is the Pivot We Have:  3 Measures (Total Sales, Sales to Parents, and Sales to Married Couples) Displayed for Each Year From 2001 to 2004

PowerPivot Named Sets:  Desired Pivot

But This is the Pivot We Want:  The “Married Couples” Measure Displayed Up Through 2002, But “Discontinuing” the Display of that Measure in 2003, Replacing it With the “Parents” Measure

I Can’t Believe I Haven’t Blogged This!

This is crazy.  I was positive I’d blogged about Named Sets.  But I searched, and it seems like I haven’t.  Ever.  And this is one of those cool little (and simple!) tricks that we all need from time to time.

Read the rest of this entry »


Guest Post: Always Show Yesterday, Today, or Tomorrow’s Data

March 28, 2013

 
Today we have a new guest poster – Miguel Escobar.  I’ve been talking to Miguel in email and Skype for a long time now and feel silly that I haven’t asked him to do a guest post until today.  But now, I have, so I can stop feeling silly.

From his writing style and creative approach to solving problems, I think you’ll see that he fits right in.

Cool trick: Always show Yesterday’s, Today’s or Tomorrow’s Data

clip_image002

Executive: Are these values correct?
Excel-guy: yes, but you need to check the dates slicers to see what dates the report is using
Executive: Ugh… I just want to click on the report and see the latest values

If you ever had this situation before let me tell you that you’re not alone on that one…I’ve been there before and it’s time to give you some cool easy tricks on how to set up a Powerpivot report that shows you the yesterday, todays, tomorrow, next week or any type of timeframe (forecasting or that sort of scenario).

Read the rest of this entry »


HASONEVALUE vs. ISFILTERED vs. HASONEFILTER

March 21, 2013

 
HASONEVALUE vs ISFILTERED vs HASONEFILTER - Three Similar PowerPivot DAX Functions

The “Return Blank for Totals” Measure Written Three Different Ways – via HASONEVALUE, ISFILTERED, and HASONEFILTER.  So far, only HASONEVALUE seems to have a flaw.

Picking up from Tuesday’s post, which drew some quick comments, let’s add one more function to our evaluation:  HASONEFILTER().

Here are the three measure formulas from the pivot above.  They are all the same except for the highlighted function:

IF(HASONEVALUE(Stores[StoreName]), [Units Sold], BLANK())

IF(ISFILTERED(Stores[StoreName]),[Units Sold],BLANK())

IF(HASONEFILTER(Stores[StoreName]),[Units Sold],BLANK())

As covered on Tuesday, HASONEVALUE “fails” when you have a parent item (Region 0, in this case) that only has one child item (Store 26 in this case). 

But ISFILTERED and HASONEFILTER do not have that problem, and they seem to be returning the exact same results.  Let’s “differentiate” them shall we?

Bring in the Slicer!

Read the rest of this entry »


ISFILTERED: A Better Way to Detect Totals

March 19, 2013

 
A Common PowerPivot Trick:  Having a Measure Do Something Different on SubTotal and GrandTotal Cells

A Common Trick:  Having a Measure Do Something Different on SubTotal and GrandTotal Cells

A Progression of Technique

It’s been awhile since I’ve written a good old honest formulas and techniques post, so I figured today would be a good time to “get my hands dirty” again.

Ever since PowerPivot v1, I’ve been writing measure formulas that “detect” whether the current pivot cell is a “total” cell (either a subtotal or grandtotal), and then doing something different if it is.

In the image above, my [Blank if Total] measure returns BLANK() for all totals, otherwise it returns the same value as the original [Units Sold] measure.

In PowerPivot v1, that formula would have looked like:

=IF(COUNTROWS(VALUES(Stores[StoreName]))=1,
    [Units Sold],
    BLANK()
)

…which basically says “if I have more than one value for StoreName, return BLANK(), but in cases where I have only one value, return the original measure.”

That was clumsy – a lot to write for a simple “do I have one value” test.  So in PowerPivot v2, they gave us the HASONEVALUE() function which makes things cleaner:

=IF(HASONEVALUE(Stores[StoreName]),
    [Units Sold],
    BLANK()
)

Read the rest of this entry »


Toggling Conditional Formatting On/Off via Slicer

February 28, 2013

 
PowerPivot Makes it Easy to Toggle Conditional Formatting On and Off via Slicers

The One and Only “Sam Rad”

imageAt the Microsoft MVP Summit last week in Seattle/Redmond, I got to see and hear a lot of cool things.  But none of that compares to seeing old friends and colleagues – some of the most extraordinary people I have ever known (and ever WILL know).

People like Sam Radakovitz for instance, aka “SamRad.”  A veteran Excel team member who briefly left to do other things but is now back on Excel.  This is Very Good News.

(Actually this is a theme – a lot of former Excel program managers in particular have “come home” from other places and have rejoined the team.  I expect this next release of Excel to be something special).

In addition to being a numbers/technical guy, Sam is very visually gifted.  He takes bland stuff and makes it sing.

We all could learn a thing or two (or a hundred) from Sam.  Even in spreadsheets, presentation quality has tremendous impact.

Read the rest of this entry »


Organizing Your Measures With a “Dummy” Table – Guest Post From Eric Hutton

February 21, 2013

 
image

“When Eric Hutton Talks, People Listen”
(Click for the Vintage TV Commercial on YouTube)

First Guest Post From Eric Hutton

Eric Hutton has been emailing back and forth with me for awhile now but I finally convinced him to write a guest post.  Perfect timing since he was just quoted in the press earlier this week.  So without further ado, the celebrity known as Eric Hutton…

Organizing your Measures with a “Dummy” Table

I have the addition of the “Measure Grid” (aka “Calculation Area”) in V2 to be of mixed benefit. Yes, it is great to have access to your measures from within the PowerPivot Window, but the manner that they did so is so very… messy.

I like to keep my spreadsheets hyper-organized and clean, because often I have to pass them off to someone else who has to be able to understand what I am doing. So I have come up with a workflow to take advantage of the measure grid while retaining a logic to the location of my measures.

Read the rest of this entry »


Stars and Snowflakes and Bears, Oh My!

January 31, 2013

 
Stars and Snowflakes in PowerPivot.  Snowflakes are slow and evil.

A PowerPivot Model with “Single-Step” Relationships is a “Star,” and one with “Daisy-Chained” Relationships is a “Snowflake.”  Snowflakes are Often Slow.  And Evil.  Don’t trust them.
(Images taken from page 194 of the book).

“Hey, Why Did Things Get So Slow?”

Got a great question this week from Dave Boylan:

“I think I read in your book that you should always use dimension (lookup table) data in your slicers and page fields (even if the same data is in your fact/data table) because they behave better and perhaps use less memory.  This makes sense as my fact table has 2MM rows and the slicer has three distinct values.”

Yes – if you have a lookup table, you should use fields from that lookup table on your pivot, rather than their equivalent fields from your data table.  My recent post on using fields from your date table on the pivot is just one example of this.

Read the rest of this entry »


Modeling Viral and Marketing Growth, Part 3 of 3

January 24, 2013

Why am I doing this in PowerPivot?  Primarily as a challenge.

This is a question I should have answered before I even started down this road.

To be honest, I did it primarily as a challenge – to stretch my brain a little bit.  If I were faced with this exact same task in my daily work, undoubtedly I would just use normal Excel formulas.  In some ways, this modeling exercise has been a deliberate misuse of PowerPivot.  A handful of parameters with no source data whatsoever – this is NOT what the PowerPivot engine was built for, which explains why the PowerPivot solution is actually significantly more difficult than the Excel solution.

“So you’ve been deliberately wasting our time??”

No, I do think there is real value in this exercise, for two reasons:

  1. Brain-stretching with new techniques always comes in handy later.  For instance, on the first post Sergey commented that he’d been thinking about loan amortization measures and this could be applied to that.
  2. I can see this technique being added, as a supplement, to a broader PowerPivot model.  For instance, a model containing lots of real customer data over time, and then a [Projected Customers] measure that forecasts future customer populations based on various assumptions and/or marketing investments.

So with that in mind, here it is:  the final installment of viral/marketing modeling in PowerPivot.

Read the rest of this entry »