17.1Preparing the table the measure calculates on
An average per customer or a number of big customers requires going through the customers, not the sales. You already know iterators, these functions like SUMX or AVERAGEX that go through a table, row by row. Their first argument decides what they go through.
17.1.1Choosing what to go through
AVERAGEX goes through the rows of a table, calculates a number for each one, then takes their average. The table you give it decides what it goes through, and therefore what the average represents.
In our data, AVERAGE( Sales[Amount] ) gives the average per sale, 141,667. For an average per customer, go through the customers:
“I want the average revenue, going customer by customer among the customers shown, calculating the revenue of each one, then taking the average.”
| City | Average Revenue per Customer |
|---|---|
| New York | 300,000 |
| Chicago | 250,000 |
| Toronto | 150,000 |
| Total | 242,857 |
This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.
VALUES supplies the visible customers. AVERAGEX calculates the number of each one, then the average. New York has 3 customers for 900,000, that is 300,000 per customer.
The rest of this lesson is part of izyDAX Pro
You have just read the first section. The next one, its animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.