Forum Discussion
Dax Countx
- 8 years ago
Try this:
CompletedQuery = COUNTX(FILTER('TraceData',TraceData[EventClass] = "RPC:Completed" || TraceData[EventClass] = "SQL:BatchCompleted"), TraceData[EventClass])
Something looks very strange in your COUNTX syntax. I've never seen an IN clause in a COUNTX statement before. Is your EventClass a boolean value or I imagine that the boolean value is being returned from the IN clause, it is either 1 or 0 I imagine. You might try wrapping it in a VALUE statement or try COUNTAX. COUNTAX works with logical values.
Hi, thanks for your reply. The EventClass data type is text.
I tried wrapping a value statement arount the column but got error 'Function CONTAINSROW does not support comparing values of type text with values of type number.
I did also try the countax function and although it parsed successfully, the filter didn't work and returned every row.
I am simply trying to count all rows where EventClass is either 'RPC:Completed' or 'SQL:BatchCompleted'
- Greg_Deckler8 years agoCommunity Champion
Try this:
CompletedQuery = COUNTX(FILTER('TraceData',TraceData[EventClass] = "RPC:Completed" || TraceData[EventClass] = "SQL:BatchCompleted"), TraceData[EventClass])- JimJim8 years agoResponsive Resident
- Greg_Deckler8 years agoCommunity Champion
Awesome! Glad we got you there!
- ppraca4 years agoFrequent Visitor
Hi, is there a soution to take the unique values from your expression:
FILTER('TraceData',TraceData[EventClass] = "RPC:Completed" || TraceData[EventClass] = "SQL:BatchCompleted")The filter returns a table and I want to count the unique values.
Thanks,
Paulo Praça