Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Measure to know productivity

I need to create an indicator of quality and production performance, in the table below I have the machines, the amount of items produced by it and the time they were stopped.

 

 

What function in power bi can I use as you are going to tell me what my productivity was for each machine compared to other machines and also how to have a general productivity index?

  • Hi Anonymous,

     

    The DAX provided in my previous post is for calculated columns rather than measures. To use measures to rank, you can write the DAX like below:

     

    Rank-Iteams01 = RANKX(ALL('Table1'),CALCULATE(SUM('Table1'[ProducedItems]),ALLEXCEPT(Table1,Table1[Machine])))

     

    Rank-Itesm/Time01 = RANKX(ALL('Table1'),DIVIDE(CALCULATE(SUM('Table1'[ProducedItems]),ALLEXCEPT(Table1,Table1[Machine])),CALCULATE(SUM(Table1[Total time]),ALLEXCEPT(Table1,'Table1'[Machine]))))

     

     

     

    Best Regards,
    Qiuyun Yu

3 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous,

     

    In your scenario, the RANKX() function should be suit for you. You can create calculated columns like below:

     

    Rank-Items = RANKX(ALL(Table1),Table1[ProducedItems])

     

    Rank-Items/Time = RANKX(ALL(Table1),DIVIDE('Table1'[ProducedItems],'Table1'[Total time]))

     

     

    Best Regards,
    Qiuyun Yu

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-qiuyu-msft

       

      I've tried your suggestion on top of the values I have, but it did not work, did I do something wrong?

       

       

       

      Rank-Items/Time = RANKX(ALL(Indicadores);DIVIDE(Indicadores[Total Produção];Indicadores[Total Tempo]))

      • v-qiuyu-msft's avatar
        v-qiuyu-msft
        Icon for Community Support rankCommunity Support

        Hi Anonymous,

         

        The DAX provided in my previous post is for calculated columns rather than measures. To use measures to rank, you can write the DAX like below:

         

        Rank-Iteams01 = RANKX(ALL('Table1'),CALCULATE(SUM('Table1'[ProducedItems]),ALLEXCEPT(Table1,Table1[Machine])))

         

        Rank-Itesm/Time01 = RANKX(ALL('Table1'),DIVIDE(CALCULATE(SUM('Table1'[ProducedItems]),ALLEXCEPT(Table1,Table1[Machine])),CALCULATE(SUM(Table1[Total time]),ALLEXCEPT(Table1,'Table1'[Machine]))))

         

         

         

        Best Regards,
        Qiuyun Yu