Hi PowerAutomate/Flow experts,
In the planner there are following tasks from projects: Lavender, Marigold & Teal
The Goal is automatically get the tasks from planner into Metrics as below

In Flow:
Since there is no way to group the tasks for relevant projects, it is hard to map them on to Metrics using PowerAutomate:
We can group by Buckets or 1-1 tasks from Planner to Metrics but looking for ways to group tasks via either labels or something else !
UPDATE: When used "gettask" to grab appliedCategories, there is no specific category shown in raw output. Also, how can we group such categories ? should we use a loop & condition ?
Added task with appliedcategories = Dark green (category18)
but still not catching it leading to escaping the condition too.
:(
...Not sure what Create Label here means and there is no current item from the Filter TaskbyLabel in new view
Thanks @Sam for your efforts to help us. It seems even after adding the expresssion, it lead to error.

Also, for the final step, is Output should be UniqueLabels ?

Update
In the step above RenamedLabelNames....there need to be ApplyToEach







Your overall question is pretty broad, however, I will answer your immediate need of "how to group tasks by label". Hopefully that will get you on your way.
Let me say first, I have yet to receive the new UI for Power Automate, so the following is based on the old UI. Just the same, you should be able to apply the same steps/expressions.
Here's the overview of the steps:

And the details behind each step/action: