You will have to run each class spread by month. There is no way run P&L for all classes by month.

From the home page screen > left navigation bar on the left > reports > all reports > business overview > Profit and Loss by Class > select run

[…]

Resolution for 'by month issue: 'How do I run the P&L for the year broken down by Class and by month?' available: Yes.

The by month issue or error code is a known issue in Quickbooks Online (QBO) and/or Quickbooks. Support for this issue is available either by self-service or paid support options. Experts are available to resolve your Quickbooks issue to ensure minimal downtime and continue running your business. First try to resolve the by month issue yourself by looking for a resolution described in the article. If it is a complex by month issue or you are unable to solve the issue, you may contact us by clicking here or by using other by month support options.

For more information about resolving issues related to by month in Quickbooks/QBO or to get support for the issue 'How do I run the P&L for the year broken down by Class and by month?', click the link below: