procurement of cannabis product, which may create fluctuations in gross profit over comparative periods as the regulatory environment changes.
Cost of goods sold are determined from costs related to the cultivation and processing of cannabis and cannabis-derived products as well as the cost of finished goods inventory purchased from third parties.
Cost of goods sold for the three months ended September 30, 2021 was $8,254,444, an increase of $742,445 compared to the three months ended September 30, 2020 of $7,511,999, driven by higher throughput and sales.
Gross profit for the three months ended September 30, 2021 was $5,114,988, representing a gross margin of 38%. This is compared to gross profit for the three months ended September 30, 2020 of $4,963,783 or a 40% gross margin. The decrease in margin was driven by an increase in inventory valuation adjustments of $199,672 compared to the three months ended September 30, 2020. Excluding inventory valuation adjustments, margins were relatively flat. The Minnesota retail market saw slight margin expansion due to increased sales driven by the addition of four new dispensaries relative to September 30, 2020. The Minnesota margin expansion was offset by slight margin compression in New York and Arizona.
Our current production capacity has not been fully realized and we expect future gross profits to increase with revenue growth reflective of higher demand, increased product output and new product development. However, we expect gradual price compression as markets mature that could place downward pressure on our retail and wholesale gross margins.
Total Expenses
Total expenses other than the cost of goods sold consist of selling costs to support customer relationships, marketing, and branding activities. It also includes a significant investment in the corporate infrastructure required to support ongoing business.
Selling costs generally correlate to revenue. As a percentage of sales, we expect selling costs to remain relatively flat in its more established operational markets (Minnesota and New York) and decrease in developing markets as business continues to grow (Arizona, New Mexico, and Maryland). The decrease is expected to be driven primarily by the growth of retail and wholesale channels to sustainable market share.
General and administrative expenses also include costs incurred at the corporate offices, primarily related to personnel costs, including salaries, benefits, and other professional service costs, as well as corporate insurance, legal and professional fees associated with being a publicly traded company. We expect this spend to decrease as a percentage of revenue as sales continue to ramp up in all markets. We anticipate that share-based compensation expenses will continue to persist in order to recruit and retain competitive talent.
Total expenses for the three months ended September 30, 2021 were $9,245,849 an increase of $2,012,880 compared to total expenses of $7,232,969 for the three months ended September 30, 2020. The increase in total expenses was attributable to a increase in stock-based compensation expenses of approximately $0.3 million and an increase general and administrative expenses of $1.6 million which was driven by significant operational buildouts in existing markets, specifically Arizona and Maryland, where we are in the process of large cultivation and manufacturing expansion projects.
Operating Loss before Income Taxes
Operating loss before other income (expense) and provision for income taxes for the three months ended September 30, 2021 was $(4,130,861), an increase of $1,861,675 compared to $(2,269,186) for the three months ended September 30, 2020.
Total Other Income (Expense)
Total other expense for the three months ended September 30, 2021 was $(1,552,370), a change of $12,776,560 compared to other income of $11,224,190 for the three months ended September 30, 2020. This change is primarily attributable to the gain on disposal of PAMS during the three months ended September 30, 2020 of 16,884,173.