Hi @scootzinc ,
I suggest you to try code as below to create measures.
Spend based on vendor & group, year 2023 =
CALCULATE(SUM('Table'[#spend]),FILTER(ALLEXCEPT('Table','Table'[vendor],'Table'[group]),'Table'[year] = 2023))
IF(MAX('Table'[year]) = 2023,RANKX(ALL('Table'),[Spend based on vendor & group, year 2023],,DESC,Dense))
VAR _MAXRANK =
MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[year] = 2023 ), [Rank] )
VAR _TOP80 = 0.8 * _MAXRANK
MAX ( 'Table'[year] ) = 2023,
IF ( [Rank] <= _TOP80, "Top 80 %", "Bottom 20%" )
Result is as below.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.