18.4A running total without dates, with WINDOW

In Excel
ExcelSUM(OFFSET(…))
Match

A running total does not always follow the calendar. You may want to accumulate your customers, from the largest to the smallest, to find out how many of them make up most of the sales. No dates here, only an order.

18.4.1Accumulating in a chosen order

A customer’s running total adds up their figure and that of every customer who does better, or as well. Let us place this measure in a table by customer:

Cumulative Revenue by Customer = VAR CustomerRevenue = [Revenue] RETURN CALCULATE( [Revenue], FILTER( ALL( Customers[Name] ), [Revenue] >= CustomerRevenue ) )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table
In plain words

“I want the revenue, first setting aside that of the customer, then going through all the customers, even those that were left out, and keeping only those who reach at least as much.”

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

It is the same recipe as the running total from the start. The “CustomerRevenue” variable holds the figure of the customer of the row. ALL provides all the customers, and FILTER keeps those who reach at least as much. On Kumora’s row, Orvane and Kumora come to 750,000.

Tip

Divided by the figure of all the customers, this running total gives a cumulative share. Orvane and Kumora already make up 44% of the sales. This is Pareto analysis, or the 80/20 rule. It looks for the small number of customers who make up most of the sales, often around 80% of the revenue with 20% of the customers.

Watch out!

Ribelia and Movara both reach 250,000. Each one keeps the other in its running total, and both rows show 1,250,000. For an order without ties, you need a second criterion, such as the name. WINDOW looks on its own, in its table, for a column that breaks the ties.

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next 2, their animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.