Forum Discussion
Stoo48
9 years agoFrequent Visitor
COUNTIFS Functionality in DAX
Trying to find a DAX equivilent to: ACTIVITY =COUNTIFS([fault_code],[@[fault_code]],[equipment_id],[@[equipment_id]]) Have experimented with COUNT and CALCULATE but can't find a syntax that w...
- 9 years ago
According to your description, you want to count rows which meet the criteria. Right?
You can create a measure like below:
COUNTIFS = CALCULATE ( COUNTROWS ( Table ), FILTER ( Table, Table[fault_code] = fault_code1 && Table[equipment_id] = equipment_id1 ) )Regards,
v-sihou-msft
9 years agoMicrosoft Employee
According to your description, you want to count rows which meet the criteria. Right?
You can create a measure like below:
COUNTIFS =
CALCULATE (
COUNTROWS ( Table ),
FILTER (
Table,
Table[fault_code] = fault_code1
&& Table[equipment_id] = equipment_id1
)
)
Regards,
Anonymous
6 years agoNot applicable
How does the usage/formula differ if you leave out the CALCULATE part (something like below). With some similar formulas I have had similar results by using FILTER inside COUNTROWS.
COUNTROWS ( Table ),
FILTER (
Table,
Table[fault_code] = fault_code1
&& Table[equipment_id] = equipment_id1
COUNTROWS (
FILTER (
Table,
Table[fault_code] = fault_code1
&& Table[equipment_id] = equipment_id1