Running counter to the national trend, the District of Columbia and four states had lower unemployment rates in July than they did a year earlier, the Labor Department reported yesterday.

The District rate in July was 6.9 percent, down from 7 percent in June and nearly a full percentage point below the 7.8 percent rate of July 1979.

Over the same 12-month period, the national unemployment rate shot up from 5.8 percent to 7.9 percent because of the recession. In August the national rate dropped to 7.6 percent.

The only comparable decline came in Hawaii, where the rate fell from 6.3 percent in July 1979 to 5.4 percent a year later. In Louisiana, Delaware and Rhode Island, the rates declined more modestly, the department said.

But big increases in unemployment were the norm. In Michigan, unemployment rose in July to 14.1 percent. That was the nation's highest rate, and it capped a rise of 6.4 percentage points over the 12 months.

Altogether, 10 states had unemployment rate increeases of 3 percentage points or more over 12 months, and in 38 states the rate rose at least 1 percentage point -- emphasizing the extent to which economic conditions in the District ran counter to those elsewhere in the nation.

The largest unemployment rate increases occurred in the East North Central States where durable goods manufacturing is concentrated, especially motor vehicles and parts, primary and fabricated metals, and machinery.

Outside of that region, unemployment rates rose 3 percentage points or more over 12 months in Alabama, Arkansas, Idaho, Missouri, Pennsylvania and South Carolina.