This is an interesting one, but not too difficult.
I looks like you have the first part where you need a supporting table here with your groups.
I’ll work with an example from the online portal here.
I’m presuming you’re using the dynamic grouping formula pattern for this.
Something like the below.
Profits by Custom Grouping =
VAR RankingDimension = VALUES( Customers[Customer Names] )
RETURN
CALCULATE( [Total Profits],
FILTER( RankingDimension,
COUNTROWS(
FILTER( 'Custom Groups',
RANKX( ALL( Customers[Customer Names] ), [Total Sales], , DESC ) > 'Custom Groups'[Min Rank]
&& RANKX( ALL(Customers[Customer Names] ), [Total Sales], , DESC ) <= 'Custom Groups'[Max Rank] ) ) > 0 ) )
To then get the % share all you need to do is branch out into the below.
Grouping % =
DIVIDE( [Profits by Custom Grouping],
CALCULATE( [Profits by Custom Grouping], ALL( 'Custom Groups' ) ), 0 )
This should do it.
Check out this tutorial here to learn more about this.
See how you go.
Sam