Forum Discussion
DAX Formula to get the input per process based on filter by date
- 1 year ago
Hi Anonymous - you can modify the measure to correctly calculate the total input for the selected process and take slicers into account
TotalInputPerProcess =
CALCULATE(
SUM(DRY_DS[Touched]),
ALLSELECTED(DRY_DS[defectlist]), -- Keep defect list slicer
ALLSELECTED(DRY_DS[createddatetime]), -- Keep date slicer
DRY_DS[process] = [Selected Process] -- Filter for the selected process
)For your defect rate calculation (Rate = QTY / TotalInputPerProcess), make sure you use the newly created TotalInputPerProcess measure
DefectRate =
DIVIDE(
SUM(DRY_DS[QTY]),
[TotalInputPerProcess],
0 -- Handles division by zero cases
)hope it works at your end, let me know if any adjustments.
Hi Anonymous - you can modify the measure to correctly calculate the total input for the selected process and take slicers into account
TotalInputPerProcess =
CALCULATE(
SUM(DRY_DS[Touched]),
ALLSELECTED(DRY_DS[defectlist]), -- Keep defect list slicer
ALLSELECTED(DRY_DS[createddatetime]), -- Keep date slicer
DRY_DS[process] = [Selected Process] -- Filter for the selected process
)
For your defect rate calculation (Rate = QTY / TotalInputPerProcess), make sure you use the newly created TotalInputPerProcess measure
DefectRate =
DIVIDE(
SUM(DRY_DS[QTY]),
[TotalInputPerProcess],
0 -- Handles division by zero cases
)
hope it works at your end, let me know if any adjustments.
Thanks for the reply. This is the error i'm getting from the code.
A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.