Hi,
For the condition filtering, go to the filter tab. Once you apply filter, your measures will be filtered accordingly prior creating calculated values.
For the count of observations, you may use the function ByGroup (sourcevariablename) to create a newvariable in the Calculated Items of Aggregated Measure then add this new variable in the Data Role.
Hope this helps