Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DiKar
Helper I
Helper I

Recreating FIXED calculation from Tableau

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]))

8 REPLIES 8
johnt75
Super User
Super User

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 😕

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.