Using two Apple IDs on one Mac I have a personal Apple ID which I use for iTunes and iCloud on my MacBook Air and iPhone. Now I have a MacBook Pro which uses different iCloud account.

I want to know if I can use my earlier Apple ID on this new Mac just for Apple music?

Apple Support document, Sign in with your Apple ID appears to advice against it.
It is quite possible to use different Apple IDs for iCloud and iTunes. Even the Apple Support document, Sign in with your Apple ID - Use different Apple IDs for iCloud and iTunes mentions it.

Use different Apple IDs for iCloud and iTunes
We recommend that you use the same Apple ID for all Apple services on your device—including the iTunes &amp; App Stores and iCloud. Using multiple Apple IDs might be confusing and cause issues with accessing purchased content or using some services.
But if you already have different Apple IDs that you want to use with iCloud and the iTunes &amp; App Stores, follow these steps.
On your iPhone, iPad, or iPod touch:

If you're using iOS 10.3 or later, go to Settings and tap Sign in to your [device]. Enter the Apple ID that you want to use with iCloud. Go back to Settings, scroll down, and tap iTunes &amp; App Stores. Tap Apple ID: [your name] &gt; Sign Out. Then sign in with the Apple ID that you want to use with iTunes.

If you're using iOS 10.2 or earlier, go to Settings &gt; iCloud and sign in with the Apple ID that you want to use with iCloud. Go back to Settings &gt; iTunes &amp; App Stores and sign in with the Apple ID that you want to use with iTunes.


On your Mac, go to System Preferences &gt; iCloud and sign in with the Apple ID that you want to use with iCloud. Go to iTunes &gt; Account &gt; Sign In. Enter the Apple ID that you want to use with iTunes.
If you use multiple Apple IDs and want to restore your device from a backup, you can learn more about iCloud or iTunes backups.
If you have multiple Apple IDs, you can’t merge them.

So, it is feasible to use separate to use separate Apple IDs for iTunes and iCloud. To use the desired Apple ID for Apple Music, simply launch iTunes, and in the Menu bar go to Account → Sign Out. Now sign in with the desired Apple ID.