Try this?
if(GetSelectedCount(CalDate)=0,
(rank(aggr(Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Entry-={$(vElectronic)},Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry)
/
Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry),$(vRankDrill_Profile)),4,1)),
(rank(aggr(Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Entry-={$(vElectronic)},Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry)
/
Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry),$(vRankDrill_Profile)),4,1))
)
Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)