This video will teach you how to setup up tracking expenses in Quickbooks Online by departments.

To turn on this feature you will need a QBO Plus or Advanced subscription.

Gear Icon> Account and Settings > Advanced > Turn on location tracking and then select Departments label.