Forum Discussion
COUNTIFS Functionality in DAX
- 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,
If you just want the count you can achieve this without any Measures or Calculated Columns.
Just create a Matrix.
Place Name in Rows - place Color in Columns - finally place either Name or Color in Values and change to display Count.
If you insist on having a COLUMN with this information
Concatenate the possible Name-Color combinations in a column and then count the results of that column
So first create a COLUMN:
Column = 'Table'[Name]&"-"&"'Table'[Color]
then create a COLUMN:
Countifs Column = CALCULATE ( COUNTA ( 'Table'[Column] ), ALLEXCEPT('Table', 'Table'[Column] ) )
That should do it! Good Luck! :smileyhappy:
This should be the solution - this is the closest i can see to an alternative to excel's COUNTIF function. Alot of the other solutions require you to specify each variable or create a seperate list - this allows the variables to change by row. Thanks 🙂