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

Get Fabric certified for FREE! Don't miss your chance! 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.