Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Creating a Visual of Unique Combinations

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!

6 REPLIES 6
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try applying filters to visual.

vcgaomsft_0-1653989895842.png

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

Anonymous
Not applicable

Freddiec03_0-1654115095463.png

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.

vcgaomsft_0-1654139000642.png

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)

vcgaomsft_1-1654139152770.png

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

Anonymous
Not applicable

Did my last comment make sense? if not I can try explaining in more detail. Thanks for the help!

Anonymous
Not applicable

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.

amitchandak
Super User
Super User

@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)

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.