Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
69 | |
59 | |
46 |