Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I am trying to create a table that shows a unique combination based off criteria.
Ex:
Product: Rank Price
a 10 5
b 12 10
c 9 7
Id like to find a unique combination of the highest ranked products that fit into a certain budget. Thoughts? Thanks!
Hi @Anonymous ,
Try applying filters to visual.
If this does not work for you, can you provide sample data and show the expected output? Thanks in advance.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
So out of this data I'd like to create a table like you posted above. (Player, allocated points, DK price) the criteria would be to get the combination of 6 players with the highest sum of allocated points to fit a 50k budget. Thanks
Hi @Anonymous ,
Suppose there is such a table. Sort by allocated points.
New a column.
Column =
VAR _ranking ='Table'[Ranking]
var _budget =
CALCULATE(SUM('Table'[DK Price]),FILTER('Table','Table'[Ranking]>=_ranking&&'Table'[Ranking]<=_ranking+5))
VAR _matched = IF(_budget<50000,'Table'[Ranking])
RETURN
_matched
New a table.
Table 2 =
VAR _min = MIN('Table'[Column])
RETURN
FILTER('Table','Table'[Ranking]>=_min && 'Table'[Ranking]<=_min+5)
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Did my last comment make sense? if not I can try explaining in more detail. Thanks for the help!
So that all makes sense but the one problem I am running into is that the allocated points is not a set data.... the point totals change when filters are applied. I have the allocated points in a visual table as a measure. I tried using the same formula as the measure in a new column but each cell produced 1 and not the actual number.
@Anonymous , I do not see two column
If you need more than one column in Rank
You can use
ranxk(allselected(Table[Product], table[Rank]), calculate(Sum(Table[Price])), ,desc,dense)
User | Count |
---|---|
102 | |
91 | |
85 | |
77 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |