Thanks, Chris. And thank you to everyone for joining our call today. First, I want to thank all the Asanas for their commitment to our customers, each other and our mission during these unprecedented times. We're incredibly proud of the team's ability to deliver in this environment.
As Dustin said, we had a strong quarter in Q2. While there were some short-term headwinds in the quarter due to the pandemic, our overall performance remained strong, and our confidence in the long-term opportunity is greater than ever.
Revenue in the quarter was $52 million, up 57% year-over-year. This is a reflection of the value we provide to our customers and our focus on their experience on the Asana platform. We deliver consumer-grade enterprise software that is easy to adopt and can scale across organizations.
Let me spend a moment sharing some additional Q2 metrics. We saw strong growth in our number of customers spending $5,000 or more with us on an annualized basis, which grew 65% year-over-year. And we saw even stronger growth in our larger customers. The number of customers spending $50,000 or more with us on an annualized basis grew 160% year-over-year. Subscriptions of $5,000 and over on an annualized basis represented 58% of our revenues in Q2 compared to 47% of our revenue in the year-ago quarter and are up 92% year-over-year.
Please note, this represents all customers $5,000 and over, including customers over $50,000. We added 5,000 net new paying customers in the quarter and now have over 82,000 paying customers with over 1.3 million paid users globally.
Before I talk more about the quarter, let me discuss our business model. A majority of our paying customers initially adopt on our platform through self-service and free trials. Teams and individuals can try Asana using our free offer, which has limited functionality or a trial on one of our paid subscription plans.
Our pricing strategy helps enable customer expansion. We offer 4 level of service: basic, premium, business and enterprise. Basic is our free plan, while each subsequent plan have more robust set of functionality and stronger administrative controls. Paying customers typically pay on a monthly or annual basis. Our highest priced plans are business and enterprise and have been gaining significant traction, demonstrating the value we continue to deliver to our customers.
Asana is a simple and easy product for teams to adopt to track their work. Once they have started, teams often increase the number of users or begin to use Asana for new workflows and new use cases.
Our dollar-based net retention rate reflects this ease of adoption and the stickiness of the product. In Q2, our overall dollar-based net retention rate was over 115%. With the onset of the pandemic, the overall dollar-based net retention rate was negatively impacted primarily by smaller teams and economically impacted sectors. We expect our overall dollar-based net retention rate to be representative of the macroeconomic impact for a few more quarters because the dollar-based net retention rate is a trailing 4-quarter average calculation, and thus, a lagging indicator. For customers spending $5,000 or more with us on an annualized basis, it was over 125%. And for customers spending $50,000 or more with us on an annualized basis, it was over 140%. And as we continue to expand, we will focus on investing in growth that will result in leverage long term.
Before turning to expense items and profitability, I would like to point out that I will be discussing non-GAAP results in the balance of my remarks. Gross margins came in at 86.6%, up slightly year-over-year. We expect full year non-GAAP gross margins of around 86%. R&D was $23.3 million or 45% of revenue and up 52% year-over-year, as we focus on enhancing our software architecture and adding new features and functionality to our platform. Sales and marketing was $37.3 million or 72% of revenue, up 90% year-over-year, illustrating our confidence in the growing opportunity and our investment in both the top-of-funnel and sales-assisted expansion. G&A was $11.6 million or 22% of revenue, up 57% year-over-year, growing to scale our infrastructure for public company readiness.
As a result, total non-GAAP operating loss was $27.2 million. Operating margin came in at negative 52%. Non-GAAP net loss was $26.3 million versus $13.7 million in the year ago quarter. Non-GAAP loss per share was $0.34 versus a loss per share of $0.20 the previous year. Total cash and marketable security balances were approximately $456 million, headlining our strong balance sheet.
Free cash flow is defined as net cash from operating activities, less cash used for property and equipment and capitalized software costs, excluding nonrecurring items, such as the direct listing fees and expenses, and the build-out of our San Francisco office. In Q2, free cash flow was negative $21.9 million versus negative $6.5 million in the year ago quarter.
Our total Q2 deferred revenue was $75 million, up 61% year-over-year and up 7% sequentially. As you will see on our balance sheet, $73.8 million of deferred revenue was in current liabilities, while $1.2 million, which represents long-term deferred, was included in other liabilities.
Please note, we consider revenue growth to be the best indicator for the health of our business. And while we do recognize that investors look at other metrics such as RPO, deferred revenue and calculated billings, we do not consider these metrics to be good leading indicators at this stage of the business.
With our bottoms-up model, we engage new users with a low-friction entry point package. That includes simple per-user pricing and monthly contracts. So by design, a material portion of our revenue base is on monthly contracts, which are not reflected in our deferred revenue.
As we look towards next quarter and the remainder of the year, I would like to reinforce the following: first, clarity and alignment are more important than ever for teams to collaborate effectively. Second, while the pandemic will continue to have an unpredictable short-term impact to our business, we are ultimately a beneficiary of the secular tailwinds. Third, our top-of-funnel activity remains strong as a result of the remote work movement. And finally, we are well capitalized, enabling us to invest further into the opportunity and fortify our leadership position.
So let's turn to our outlook. For the third quarter of fiscal year 2021, we expect the following: revenues of $53.5 million to $54.5 million, representing 40% to 43% year-over-year growth. We expect non-GAAP loss from operations of $42 million to $40 million and non-GAAP net loss per share of $0.38 and to $0.36, assuming basic and diluted weighted average shares outstanding of approximately 112 million.
For the full fiscal year 2021, Asana expects the following: revenue of $210 million to $213 million, representing 47% to 49% year-over-year growth. We expect non-GAAP operating loss of $140 million to $136 million and non-GAAP net loss per share of $1.33 to $1.30, assuming basic and diluted weighted average shares outstanding of approximately 105 million. And as we look out to fiscal year '22, even with all the uncertainty in today's environment, we believe we are well positioned to grow revenue in the 30%-plus range.
In summary, we are focused on growth and the enormous market opportunity for work management. Remote work is accelerating the need for teams to stay aligned with clarity and accountability. We'll invest in our work graph architecture and our product that customers love. And lastly, we will continue to invest in growth and scale to translate our strong unit economics into long-term leverage and sustainable growth.
I would like to turn the call back over to Catherine for questions and answers. Catherine?