Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dataset example:
SALE_ID | PRICE_SOLD |
1001 | 10 |
1001 | 20 |
1002 | 30 |
1003 | 40 |
There are 3 sales, 1001, 1002, and 1003.
1001 has two line items. I need to calculate average sale total. For instance, ((10 + 20) + 30 + 40) / 3
How do I calculate that in DAX?
Thank you.
Solved! Go to Solution.
Hi @Anonymous
You can create a measure like this:
Measure =
VAR _cntOfUsers = DISTINCTCOUNT('Table (2)'[SALE_ID])
VAR _sumOfSales = Sum('Table (2)'[PRICE_SOLD])
RETURN DIVIDE(_sumOfSales,_cntOfUsers,0)
_______________
If I helped, please accept the solution and give kudos! 😀
Hi @Anonymous
You can create a measure like this:
Measure =
VAR _cntOfUsers = DISTINCTCOUNT('Table (2)'[SALE_ID])
VAR _sumOfSales = Sum('Table (2)'[PRICE_SOLD])
RETURN DIVIDE(_sumOfSales,_cntOfUsers,0)
_______________
If I helped, please accept the solution and give kudos! 😀
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |