Forum Discussion

PowPow's avatar
PowPow
Frequent Visitor
10 years ago
Solved

Average Order Lines Count

Hi all,   having trouble wrapping my head around a measure calculation and would appreciate some pointers.   I have power pivot model based on a data warehouse (perfect star schema). The sales fa...
  • PowPow's avatar
    PowPow
    10 years ago

    Hi Harris,

     

    I've managed to solve it by bringing Order Number and Order Line to the fact table and then creating a measure like so:

     

    =AVERAGEX(SUMMARIZE('fact';'fact'[OrderNo];"AVG";DISTINCTCOUNT('fact'[OrderLineNo]));[AVG])

     

    Not sure this is the best approach but it works.

     

    Thanks for your help,