Instructor-led training - powerpivot courses london

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Excel PowerPivot Training CoursesExcel PowerPivot Training Courses

The business intelligence tool for Excel

Face to face / Online public schedule & onsite training. Restaurant lunch included at STL venues.

Designed for Excel 365

From £495 List price £650

Microsoft PowerPivot is an add on for Excel that provides Business Intelligence functionality & reporting within the familiar environment of Excel.

PowerPivot provides the real power to crunch & analyse data on a scale previously unimaginable with pivot tables.

Now it is possible to process millions of rows of data in Excel enabling deeper business insight and shorter decision making cycles.

We offer public schedule courses for training power bi London. Courses never cancelled, include a restaurant lunch and 2 years post training support and easy same day rescheduling.

Free manuals

We are providing a range of our course manuals free of charge.

Why not share this resource with your friends and colleagues?

Training manual sample

Below are some extracts from our Excel training manuals.

Unit 11 – A selection of DAX Functions 

In this unit, you will learn how to: 

  • Understand the DAX function CALCULATE() 

  • Understand the DAX function ALL()  

  • Understand the DAX function ALLEXCEPT() 

  • Understand the DAX function RELATED() 

  • Understand the DAX function SUMX() 

  • Understand the DAX function COUNTX() 

  • Understand the DAX function COUNTAX() 

CALCULATE() 

Have you ever used the Excel function SUMIF(), or perhaps its newer cousin, SUMIFS()? 

I describe CALCULATE() as “the SUMIF/SUMIFS you always wish youd had.”  You are going to love this function, because it works wonders. 

In case you are one of the pivot pros who managed to skip SUMIF() and SUMIFS() in normal Excel, they are both very useful functions: they sum up a column you specify, but filter out rows that don’t fit the filter criteria you specify in the formula. So, for instance, you can use SUMIF to sum up a column of Sales figures, but only for rows in the table where the Year column contains 2012. 

Does that sound familiar? It sounds a lot like the Golden Rules from the prior chapter “filter, then arithmetic. An interesting similarity, and CALCULATE() continues in that same tradition. 

Anyway, CALCULATE() is superior to SUMIF() and SUMIFS() in three fundamental ways: 

  1. It has cleaner syntax. This is the smallest of the three advantages, but it feels good.  

  1. It is ananything” IF, and not limited to SUM/COUNT/AVERAGE. There is no MAXIF() function in Excel for instance. It is literally unlimited it allows you to take any aggregation function (or even a complex multi-function expression!) and quickly produce an IF version of it. 

  1. It can be used in pivots (as part of a measure), which normal SUMIF() cannot. 

CALCULATE(re expression>, ter1>, ter2>, …) 

Ex:  CALCULATE(SUM(Sales[Margin]), Sales[Year]=2001) 

Ex:  CALCULATE([Sales per Day], Sales[Year]=2002, Sales[ProductKey]=313) 

Start with a simple pivot. Year on rows, [Total Sales] measure on values: 

 

OK, lets add a new measure, one that is always filtered to Year=2002: 

CALCULATE([Total Sales], Sales[Year]=2002) 

The results are shown below; 

 

Do those results surprise you? I bet they are close to what you expected, but maybe not exactly. You might have expected years 2001 and 2003 to display zeroes for our new measure, and you might be scratching your head a bit about the grand total cell, but otherwise, having the new measure always return the 2002 value from the original measure is probably pretty instinctive. 

Its not very often that I write a CALCULATE measure that filters against a column that is also on the pivot (Sales[Year] in this case). That seldom makes any real-world sense. I just started out like this so you can see that the $6,530,344 number matches up. 

So, to make this a bit more realistic, lets take Year off of the pivot and put MonthNum on there instead: 

 

This probably makes even more sense than the prior pivot. The grand total is still that $6.5M number, but every other cell returns a distinct number – the sales from 2002 matching the MonthNum from the pivot. 

How CALCULATE() Works 

Now that weve looked at a couple of examples, lets examine how CALCULATE() truly works, because that will clear up the handful of somewhat unexpected results in that first example. 

There are three key points to know about CALCULATE(), specifically about the ter> arguments: 

  1. The ter> arguments operate during the “filter phase of measure calculation. They modify the filter context provided by the pivot this happens before the filters are applied to the source tables, and therefore also before the arithmetic phase. 

  1. If a ter> argument acts on a column that IS already on the pivot, it will override the pivot context for that column. So, in our first example above, the pivot is saying that Sales[Year]=2001, but I have Sales[Year]=2002 in my CALCULATE(), so the pivotsopinion” of 2001 is completely overridden by CALCULATE(), and becomes 2002. That is why even the 2001 and 2003 cells (and the grand total cell) in the first example returned the 2002 sales number. 

  1. If a ter> argument acts on a column that is NOT already on the pivot, that ter> will purely add to the filter context. In our second example, where we had Sales[MonthNum] on the pivot but not Sales[Year], the Sales[Year]=2002 filter was applied on top of the Month context coming in from the pivot, and so we received the intersection 2002 sales for month 1, 2002 sales for month 2, etc. 

Examples of CALCULATE() 

The [2002 Sales] measure that I have been using as an example so far is a good way to show you how CALCULATE() works, but it might not seem terribly useful. So, let me show you two quick examples that are much more broadly applicable. 

Transactions of a Certain Type 

Here is one that I see all the time in the retail sales business: not all transactions are normal sales. Some businesses record many different transaction types including “Normal Transaction,” “Refund, and “Promotional Sales Transaction. 

My database has a column for that, so I went ahead and imported it into my Sales table (using Table Properties). Here, we see that it has three values: 

 

 

 

I now want to write four new measures, defined here in English: 

  • Regular Sales Just transactions of type 1 

  • Promotional” Sales Just transaction of type 3 

  • Refunds” transactions of type 2, expressed as a negative number 

  • “Net Sales” Regular plus Promotional sales, less Refunds 

Now, here are the formulas for each: 

[Regular Sales] =CALCULATE([Total Sales], Sales[TransType]=1) 

[Promo Sales] =CALCULATE([Total Sales], Sales[TransType]=3) 

[Refunds] =CALCULATE([Total Sales], Sales[TransType]=2) * -1 

[Net Sales] =[Regular Sales] + [Promotional Sales] + [Refunds] 

The results are displayed below: 

 

Let us continue down the Practical Road, lets see what percentage of our sales are due to us running promotional campaigns: 

[Pct Sales on Promo] =[Promo Sales] / ([Regular Sales] + [Promotional Sales]) 

Results: 

 

 

Mathematical Operator in  

In a ter> argument to CALCULATE(), you are not limited to the “=” operator. You can also use: 

  • < (Less than) 

  • >(Greater than) 

  • <= (Less than or equal to) 

  • >= (Greater than or equal to) 

  • <>(Not equal to) 

Evaluation of Multiple in a Single CALCULATE() 

All of the ter> arguments in a single CALCULATE() behave as if they are wrapped in an AND() function. 

In other words, a row must match every ter> argument in order to be included in the calculation. 

If you need an OR()” style of operation, you can use the “||” operatorFor instance: 

CALCULATE([Total Sales], Sales[TransType]=1 || Sales[TransType]=3) 

ALL() The “Remove a Filter” Function 

The Basics 

The ALL() function is used within a CALCULATE(), as one of the ter> arguments, to remove a filter from the filter context. Maybe we want to analyse each monthly net sales figure against the total sales ignoring the year filter applied by the year slicer. 

Lets jump straight to an example Consider the following pivot: [Net Sales] displayed by MonthNum, with Year on a slicer: 

 

 

OK, time for a new measure: 

[All Month Net Sales] =CALCULATE([Net Sales], ALL(Sales[MonthNum])) 

And the results: 

 

 

The Practical Basics 

Lets do a simple ratio of the two measures already on the pivot: 

[Pct of All Month Net Sales] = [Net Sales] / [Month Net Sales] 

Results: 

 

We can remove the original ALL measure from the pivot and the new “pct of total” measure still works: 

Negating a Slicer 

 

This one is useful, but also a lot of fun Lets start with the following pivot (we just added ProductKey as a slicer, and made a few selections). 

Now add a measure that ignores any filters on ProductKey: 

[Net Sales - All Products] =CALCULATE([Net Sales], ALL(Sales[ProductKey])) 

And a measure that is the ratio of that to the original [Net Sales]: 

[Selected Products Pct] =[Net Sales] / [Net Sales - All Products] 

 

Results: 

 

 

ALLEXCEPT() 

Lets say you have 12 columns in a table, and you want to apply ALL() to 11 of the 12, but leave one of them alone. 

You can then use ALLEXCEPT(<Table>, <col1 to leave alone>, <col2 to leave alone>…) 

ALLEXCEPT(Sales, Sales[ProductKey]) 

Is the same as listing out every column in the Sales table except ProductKey: 

ALL Sales[OrderQuantity], Sales[UnitPrice], Sales[ProductCost], Sales[CustomerKey], Sales[OrderDate], Sales[MonthNum], … 

RELATED() 

The RELATED function is one of the most common and popular of all the dax filter functions. This table must be on the Many side of a one to many relationship. It returns a single value that is related to the current row. The syntax of the function is as follows: 

=RELATED(Column) 

COUNTX() 

The COUNTX function counts the number of rows in a column that contain numbers or dates. 

=COUNTX(Table,Expression) – This function works with Numerical data and dates. 

SUMX() 

The Sumx function is used when you want to sum the values in a column based on specific row criteria. For example, you may want to know the shipping costs for a particular export. The syntax for the formula is as follows: 

=Sumx(Table, Expression) – Table is the table that contains the rows that need to be evaluated and the expression is the expression or filter that needs to be evaluated for each row of the table. The Sumx function will commonly use Calculatetable or Relatedtable functions in the first argument. 

COUNTAX() 

The COUNTAX function counts nonblank results when evaluating the result of an expression over a table. It is used to iterate through the rows in a table and count rows where the specified expressions results in a nonblank result. The syntax is as follows: 

=COUNTAX(Table,Expression) (No content yet)

Thanks. Your download will begin shortly.

Please help us

Share or create a link to this manual today!

Just follow these simple instructions...


Server loaded in 0.66 secs.