Forum Discussion
TSantoro99
8 years agoNew Member
Countif with multiple criteria - DAX
Hello, I am looking for some assistance in writing a DAX formula which will act as a countif with multiple criteria. I have the excel version here with some simplified data for an example: ...
- Anonymous8 years ago
Hi TSantoro99,
You can create a column by concatenating the columns id and week with M code in your Query Editor, like this:
#"Added Custom" = Table.AddColumn(#"Previous step", "Concatenated", each [id]&"_"&[Week])
and then using DAX create a column with the count of occurrences of the concatenated values, using this formula:Count_occurence =
COUNTX (
FILTER ( Table; EARLIER ( Table[Concatenated] ) = Table[Concatenated] );
Table[Concatenated]
)Regards.
Anonymous
8 years agoNot applicable
Hi TSantoro99,
You can create a column by concatenating the columns id and week with M code in your Query Editor, like this:
#"Added Custom" = Table.AddColumn(#"Previous step", "Concatenated", each [id]&"_"&[Week])
and then using DAX create a column with the count of occurrences of the concatenated values, using this formula:
Count_occurence =
COUNTX (
FILTER ( Table; EARLIER ( Table[Concatenated] ) = Table[Concatenated] );
Table[Concatenated]
)
Regards.
TSantoro99
8 years agoNew Member
Anonymous - Thank you so much Felipe! You have saved me many hours of hair-pulling and frustration trying to get that to work! It looks excellent and is exactly what I needed. :smileyvery-happy: Many, many, thanks!