How to use aggregate function with select statement in MSDAX

How to use aggregate function with select statement 

 select sum(amountMST) from ledgerTrans;  
 sumAmountMST = ledgerTrans.amountMST;  
 select count(recId) from ledgerTrans;  
 countLedgerTrans = ledgerTrans.recId;