I have an excel file which contains the following columns: position (machine), company, workshop, date, article, quantity produced, quantity rejected, machine opening time. I want to calculate % productivity dax formula how to do it
position (machine) | company | workshop | date | article | quantity produced | quantity rejected | machine opening time |
---|---|---|---|---|---|---|---|
Bossar | Ind | GIAS1 | 1/2/2024 | PFSN036 | 291 | 0 | 7.5 |
Hassia | Men | GIAS2 | 5/3/2024 | PFV058 | 300 | 1 | 9 |
i have tried this :
%productivity =
DIVIDE(
SUM('Table'[quantity produced]),
SUM('Table'[machine opening time]),
0
)
but doesn’t done the right result
7
I think you are looking for % produced by company for all produced?
You can use ALLSELECTED
to return all rows filtered in the table.
Try:
% produced =
var allProduced =
CALCULATE(
SUM('Table'[quantity produced]),
ALLSELECTED('Table')
)
return
DIVIDE(
SUM('Table'[quantity produced]),
allProduced,
0
)
2
Also, you are also missing the * 100 at the end to make it a percentage
try this:
Productivity Percentage =
DIVIDE(
SUM('Table'[Quantity Produced]) - SUM('Table'[Quantity Rejected]),
SUM('Table'[Machine Opening Time]),
0
) * 100