Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi all,
I'm trying to create a measure that returns the average LTV for all customers in table.
The table has individual product purchases for rows, so I want to add up all the instances of a product purchased's sales for that customer.
| CustomerID | Sales |
| 1 | 4158 |
| 2 | 17155 |
| 2 | 17155 |
| 2 | 17155 |
| 2 | 17155 |
| 2 | 18018 |
| 2 | 520 |
| 3 | 5709 |
| 3 | 5709 |
| 3 | 17655 |
| 3 | 17655 |
If I was doing this on Excel, I would create a SUMIF looking at the CustomerID column, matching CustomerID with the ID I want to sum first, then select the Sales column. Drag down to SUMIF all customers, then just select them all and look at the average on the bottom of Excel.
I found a couple of CALCULATE and SUMX formulas online that check for some specific expression, but the expression I've tried isn't working when I'm trying to recall CustomerID.
Ex.
Solved! Go to Solution.
@RyanNewportJP First create a measure for Total Sales per Customer
TotalSalesPerCustomer =
SUMX(
VALUES(Table[CustomerID]),
CALCULATE(SUM(Table[Sales]))
)
Then create a measure for Average LTV
AverageLTV =
AVERAGEX(
VALUES(Table[CustomerID]),
[TotalSalesPerCustomer]
)
Proud to be a Super User! |
|
It helped me also, Thank you so much.
@RyanNewportJP First create a measure for Total Sales per Customer
TotalSalesPerCustomer =
SUMX(
VALUES(Table[CustomerID]),
CALCULATE(SUM(Table[Sales]))
)
Then create a measure for Average LTV
AverageLTV =
AVERAGEX(
VALUES(Table[CustomerID]),
[TotalSalesPerCustomer]
)
Proud to be a Super User! |
|
Thank you very much! This worked!
Can I ask why it works?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 51 | |
| 36 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |