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 funct...
  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    9 years ago

    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