If you have 1 dimension in X-axis, 1 dimension in Break by and 2 measures as in the below screenshot, try the below approach. You may need to adjust the script if you have different number of items under each panels.
Here it will create additional items in the legend. You can replace '(2)' in the script to a better text that allow you to distinguish between 2 measures.
If you replace the type 'line' with 'column' in the script, you will get the widget as below:
I wanted to follow up to see if the solution offered by Benji_PaldiTeam worked for you
If so, please click the 'Accept as Solution' button so that other users with the same questions can find the answer faster. If not, please let us know so that we can continue to help.