Need help writing this expression

I need an expression that does this uses these columns:

Salary
QB
RB
TE
FLEX
WR
DEF
Points

In the expression i need it to find the MAX points it can calculate based on the points each position is projected - with these constraints:

  • Salary cannot exceed $50,000
  • Number of QB = 1
  • Number of RB = 2
  • Number of WR = 3
  • Number of Flex = 1
  • Number of TE = 1
  • Number of Def = 1

Here are two pics of my table (scrolled over to show complete table):

Are you looking something like…
MAX(SELECT(TableName[Points],AND([Salaray]<=50000,[QB]=1,[RB]=2,[WR]=3,[Flex]=1,[TE]=1,[Def]=1)))

Ok. Your expression was good - however it did not give me anything:

Each column ([QB], [RB], [WR], [TE], [FLEX], [DEF]) show all players in list. But i want your expression to choose the best ones (based on top projected points) and stay within my salary —>>ALL with having

only:
1 - QB
2- RB
1-DEF
1-TE
1-FLEX
3-WR

Could you make it choose the best players and stay at or under 50,000 and then show which players do that?

Again:
Only 1 QB
Only 2 RB
Only 1 FLEX
Only 1 DEF
Only 3 WR
Only 1 TE

From your expression - I added what i want:

MAX(SELECT(Player Pool[Total Points],AND([Total Salary]<=50000,[TOPQBWith most point]=Canonlychoose1,[TopRBwithmost points]=Canonlychoose2,[topWRwithmost points]=canonlychoose3,[topFlexwith most points]=canonlychoose1,[topTEwithmost points]=canonlychoose1,[topDefwithmostpoints]=canonlychoose1)))

Thoughts?