Forum Discussion

PasiNiinikoski's avatar
PasiNiinikoski
Frequent Visitor
6 years ago

Calculating average with values more than x

I have this very simplified data sheet:

 

WorkerNameDateProductsMade
John2019/12/0140
John2019/12/0150
John2019/12/0590
John2019/12/0570
John2019/12/07110
John2019/12/15150
John2019/12/1870
John2019/12/21115

 

My workers work several shifts per day. And John is not my only worker 🙂

Lets say I would like to know how many products my workers make on the average per day. That is easy.

But lets say I would like know that information but concerning only those days that they make more than 100 products: average per day per worker.

 

Any help? In my query or in Power BI?

 

Thanks in advance,

 

Pasi Niinikoski

3 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi PasiNiinikoski 

    try a measure

    Measure = CALCULATE(AVERAGE(Query[ProductsMade]);ALLEXCEPT(Query;Query[WorkerName]);Query[ProductsMade]>100)

     

    do not hesitate to give a kudo to useful posts and mark solutions as solution

    • PasiNiinikoski's avatar
      PasiNiinikoski
      Frequent Visitor

      Hi az38 and thanks,

       

      will try that but I must first somehow calculate the sum of the ProductsMade by worker per day and then apply that measure. 

       

      -Pasi

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        PasiNiinikoski 

        ProductsMade = CALCULATE(SUM('Table'[Products]);ALLEXCEPT('Table';'Table'[WorkerName];'Table'[Date]))

         

        do not hesitate to give a kudo to useful posts and mark solutions as solution