Forum Discussion
countrows with multiple filter values selected
Hi aragu !
Let's try do it step-by-step.
Capture the Selected Test Passes:
Begin by capturing the values of Name_Testpass that have been selected in the slicer.
VAR SelectedTestpasses = VALUES('Platform_time'[Name_Testpass])
Filter the Data:
Filter the entire 'Platform_time' table to only include rows where:
The P90_pass column has a value of "FAIL".
The Name_Testpass column's value is among the selected test passes.
VAR FilteredData =
FILTER(
ALL('Platform_time'),
'Platform_time'[P90_pass] = "FAIL" &&
'Platform_time'[Name_Testpass] IN SelectedTestpasses
)
Count Unique Metrics:
From the filtered data, summarize by the Name_Metric column to get unique metrics. Then, count the number of rows in this summarized table, which will give the count of unique metrics with a "FAIL" value for the selected test passes.
COUNTROWS(
SUMMARIZE(
FilteredData,
'Platform_time'[Name_Metric]
)
)
Final Formula:
Combining the above steps, the complete DAX formula is:
Fail_Count =
VAR SelectedTestpasses = VALUES('Platform_time'[Name_Testpass])
VAR FilteredData =
FILTER(
ALL('Platform_time'),
'Platform_time'[P90_pass] = "FAIL" &&
'Platform_time'[Name_Testpass] IN SelectedTestpasses
)
RETURN
COUNTROWS(
SUMMARIZE(
FilteredData,
'Platform_time'[Name_Metric]
)
)
This formula will provide the desired count of unique Name_Metric values where P90_pass is "FAIL" for the selected Name_Testpass values.
Perhaps my colleagues will suggest a different solution @tamerj1 @annonymous1999 @OwenAuger
thank you technolog...i tried but it did not seem to fix it. for most of the measures the original formula works even with multiple filter values. there were only some that did not. so perhaps it is not a DAX issue but some other dependencies from my data structure??? I calculate P90_pass with this formula, essentially comparing my calculated P90 to a target value. I did not use the built-in percentile formula since it gives a different answer. Will the below formula (since it calculates based from filter values too) impact the FAIL COUNT formula?