Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

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

  • 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')

    • Anonymous's avatar
      Anonymous
      Not applicable

      it calculated for half an hour and gave an error can't show visual

      • johnt75's avatar
        johnt75
        Super User

        Do you have a user dimension ? Is there 1 row per order or can there be multiple rows per order ?