and utilities. Cannabis costs are affected by various state regulations that limit the sourcing and 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 June 30, 2021 was $7,318,011, a decrease of $1,306,730 compared to the three months ended June 30, 2020 of $8,624,741, driven by higher throughput across all markets decreasing fixed cost per unit.
Gross profit for the three months ended June 30, 2021 was $6,912,889, representing a gross margin of 49%. This is compared to gross profit for the three months ended June 30, 2020 of $3,590,624 or a 29% gross margin. The increase in margin was driven by higher throughput across all markets decreasing fixed cost per unit. The Minnesota retail market saw gross profit expansion of approximately $1.1 million due to increased sales driven by the addition of four new dispensaries relative to June 30, 2020. Additionally, the New York market saw gross profit expansion of approximately $1.7 million driven by a $1.1 million wholesale sale during the three months ended June 30, 2021.
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 June 30, 2021 were $10,160,451, a decrease of $5,482,167 compared to total expenses of $15,642,618 for the three months ended June 30, 2020. The decrease in total expenses was attributable to a decrease in stock- based compensation expenses of approximately $7.6 million partially offset by increase general and administrative expenses of $2.0 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 June 30, 2021 was $(3,247,562), a decrease of $8,804,432 compared to $(12,051,994) for the three months ended June 30, 2020.
Total Other Expense
Total other expense for the three months ended June 30, 2021 were $1,323,042, a decrease of $2,370,398 compared to $3,693,440 for the three months ended June 30, 2020. This decrease is primarily attributable to the gain on derivative liability of $1,531,371.