 Concentration risk can be calculated for a single bank loan or whole portfolio using a "concentration ratio".For a single loan, the concentration ratio is simply the proportion of the portfolio the loan represents (e.g.a $100 loan in a $1000 portfolio would have a ratio of 0.1 or 10%) 

For a whole portfolio, a herfindahl index is used to calculate the degree of concentration to a single name, sector of the economy or country.