You can create a specific type of product or service, to accommodate scenarios when price depends on 2 variables. For example: number of people and number of hours.
What it looks like
In the example below, imagine that booking a meeting room costs $10 / person / hour.
If you are 2 adults for 2 hours, it will cost you $40 (example below)
If you are 3 adults for 3 hours, it will cost you $90
How to create this product
Create a new product
Under setup, set price to be "No base price"
Under "booking steps", add "Participant Booking form"
Create 2 fields: People & another unit that can be "Number of hours"
The total price will be calculated by multiplying the 2 variables selected with the price