How do we calculate the sample size for a study assessing the prevalence of a condition X in a group of patients with the disease Y? Do we base on the prevalence of X in the whole populatio?
the sample size depends on the precision you require to estimate population prevalence.You do need an initial guess at the prevalence ,possibly based on whole population prevalence.
several elements that you might want to take into account, including prevalence rate in previous studies, effect size, statistical power, and also your planned statistical analysis (depends on your study design).