Forum Discussion
Using "bin" with dcount to get the distinct number of computers
- Mar 28, 2018
Hi
I am not sure if I understand what exactly you want to achieve but wouldn't something like this be solution to your request:
Perf | where CounterName == "% Processor Time" | summarize AggregatedValue = avg(CounterValue) by Computer, bin(TimeGenerated, 10m) | sort by AggregatedValue desc | where AggregatedValue > 90 | summarize AggregatedValue = dcount(Computer)
If this is not what you want can you explain how you want to use dcount as the above uses both bin and dcount.
Hi
I am not sure if I understand what exactly you want to achieve but wouldn't something like this be solution to your request:
Perf | where CounterName == "% Processor Time" | summarize AggregatedValue = avg(CounterValue) by Computer, bin(TimeGenerated, 10m) | sort by AggregatedValue desc | where AggregatedValue > 90 | summarize AggregatedValue = dcount(Computer)
If this is not what you want can you explain how you want to use dcount as the above uses both bin and dcount.
- Samuel WhiteMar 28, 2018Copper Contributor
Hi Stansislav and thanks for your help.
I hadn't thought to pipe the first results through summarize again, but that's exactly what I needed.
Just to explain a little clearer, what I am doing is creating a metric for my dashboard and I want the summary view (on the card) to be a simple number of how many things there are to investigate.
If I see a "0" then I know, nothing bad to see here... don't bother clicking though.
-Samuel
- Mar 28, 2018
Hi
Glad that the proposed solution worked. I thought it obvious initially so I was wondering if I am wrong with my assumption.