Forum Discussion

AlanMB's avatar
AlanMB
New Member
1 year ago

Emulating Excel CountIfs

Hi - I am realy struggling with this, have seen a number of posts that almost solve it but I just can't get it to work.

Difficult to explain why I need this without writing an entire essay, but below is the functon in excel I am trying to emulate

ABCDE
Connection ID Queue nameCount of IVR in CCount of non Null in CFlag Where IVR is the only Non Null
Formulas ==>  =COUNTIFS(C:C,"IVR",A:A,A3)=COUNTIFS(C:C,"<>" & "",A:A,A3) 
1 IVR26 
1 IVR26 
1 A26 
1 A26 
1 B26 
1 B26 
2 IVR33IVR Only
2 IVR33IVR Only
2 IVR33IVR Only
2  33IVR Only
2  33IVR Only
3 IVR23 
3 IVR23 
3  23 
3 C23 

I would like to get the 2 Counts ( in Coumns D & E where I have shown the Excel formula) into my query data model so that I can do a number of manipulations on my data. The dax formula that I attempted to use to create the 1st count was:

IVRCount1 = CALCULATE (
COUNTROWS ( AB_Partner_Report ),
AB_Partner_Report,
AB_Partner_Report[networkConnIDAB] = AB_Partner_Report[networkConnIDAB]
& (AB_Partner_Report[queue] = "IVR") = TRUE)

But the message "Expression.Error: The name 'CALCULATE' wasn't recognized. Make sure it's spelled correctly."

I attempted to revise the formula as:

COUNTROWS ( AB_Partner_Report ),
AB_Partner_Report,
AB_Partner_Report[networkConnIDAB] = AB_Partner_Report[networkConnIDAB]
& (AB_Partner_Report[queue] = "IVR") = TRUE

But this fails syntax every time it encounters a comma

 

5 Replies