Count grand total by using TopN or GroupBy native queries

Is there any way to calculate grand total that uses native query of TopN or GroupBy?