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!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hello,
I'm trying to recreate a calculation from Tableau that was giving the average Orders per User:
{ FIXED [UserID] : COUNTD([Order])}
I looked for possible syntax for Power BI, but have not been successful so far...here below some of my tries:
Av. count = CALCULATE(DISTINCTCOUNT('Table'[Order]), ALLEXCEPT('Table','Table'[UserID]))
Av. count = CALCULATE(COUNT('Table'[Order]), ALLEXCEPT('Table','Table'[UserID]))
Try
Avg orders per customer =
AVERAGEX (
VALUES ( 'Table'[User ID] ),
CALCULATE ( DISTINCTCOUNT ( 'Table'[Order] ) )
)
If you know you have only 1 row per order then you could replace the DISTINCTCOUNT with COUNTROWS('Table')
it calculated for half an hour and gave an error can't show visual
Do you have a user dimension ? Is there 1 row per order or can there be multiple rows per order ?
There can be multiple, hence the need to calculate the average
I understand that a user can have multiple orders, but can an order be split across multiple rows or does one row constitute an entire order? Doing a DISTINCTCOUNT of an order ID, for example, is a lot more time consuming than a simple COUNTROWS.
Also, if you have a user dimension then iterating over the values from that would be much quicker than having to scan the entire orders table to get the values.
It is spread on multiple orders (2-7, many sometimes), so the total count of orders is not important, but how many orders average a user has is what I seek. Thanks
Try
Avg orders per customer =
AVERAGEX ( VALUES ( 'Users'[User ID] ), CALCULATE ( COUNTROWS ( 'Orders' ) ) )
this solution doesn't make distinct count 😕
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 68 | |
| 59 | |
| 48 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 104 | |
| 39 | |
| 27 | |
| 27 |