Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a requirements to get the total input per process per month but it seems i'm getting an error my code and not giving me the correct value. I have a slicer to select a process that i need to show all the input and the defect performed and also have a date selection using also slicer.
To display the data i have a matrix table were the rows composed of defect list and the column is date and month, values are qty per defect, rate. the rate formula is qty/total input per process.
DAX Measure with error.
can anyone help me with the correct DAX measure
Solved! Go to Solution.
Hi @JWick1969 - 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.
Proud to be a Super User! | |
Hi @JWick1969 - 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.
Proud to be a Super User! | |
Just made some changes on the code, the grand total is correct but still not getting the correct values per defectlist if i used to get the rate. the values of test2 should be all 50,349.
TotalInputPerProcess =
CALCULATE(
SUM(DS[Touched]),
ALLSELECTED(DS[defectlist]), -- Keep defect list slicer
ALLSELECTED(DS[createddatetime]), -- Keep date slicer
filter(DS, DS[process] = [Selected Process]) -- Filter for the selected process
)
-- this is working if the process value is hardcoded
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
40 |