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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

All combinations - One List - per key

Hi guys,

 

I need your help on this. I have a list of possible results. I want a combination of them.

To be more specific , please check the table below.

 

 

theotria_3-1645438555160.png

 

 

 

And lets take an example.

For each match, i want all the combinations (as a list) between all players (i need exact one line per player ) but just with one success for each one. 

Let me make it more clear for you. Lets check match 2 as is easier for me to populate all combo 

 

The combinations would be: 

 

theotria_4-1645438703155.png

 

 

So i want only one success line but for all players per game ( game A  - Players ( A,B,C,D,E)) and i need all those combination of success.

 

Any ideas?

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Is that you want a table that contains the Cartesian product of all rows?

 

Please consider use CROSSJOIN().Perhaps you can follow the steps below.
In the first step, get the unique value of each column, using values().
In the second part, combine these unique values. Use crossjoin()
Please modify the following MEASURE according to your dataset.

measure =
VAR _name =
    VALUES ( 'table'[name] )
VAR _player =
    VALUES ( 'table'[player] )
VAR _field =
    VALUES ( 'table'[field] )
VAR _values =
    VALUES ( 'table'[values] )
RETURN
    CROSSJOIN ( _name, _player, _field, _values )

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Not very clear

A new table like ?

crossjoin(distinct(Table[Player]), distinct(table[Match]), distinct(Table[Field]) )

Anonymous
Not applicable

ok i will  try to make it easier

  1. CASE A (ACCEPTABLE VALUE 1 OR 2)
  2. CASE B ( ACCEPTABLE VALUE A)
  3. CASE C ( ACCEPTABLE VALUES 2,5,8)

I want all combo with one acceptable value per case. 

For the example above :

A_1, B_A, C_2

A_2,  B_A, C_2

A_1, B_A, C_5

A_2, B_A, C_5

A_1, B_A, C_8

A_2, B_A, C_8.

 

All the possible values per key  in my dataset are presented as a line as the screenshot below :

 

 

theotria_0-1645443412238.png

I have to find a way to populate all the possible combinations (per match) in one list

Better?

 

 

Hi @Anonymous ,

 

Is that you want a table that contains the Cartesian product of all rows?

 

Please consider use CROSSJOIN().Perhaps you can follow the steps below.
In the first step, get the unique value of each column, using values().
In the second part, combine these unique values. Use crossjoin()
Please modify the following MEASURE according to your dataset.

measure =
VAR _name =
    VALUES ( 'table'[name] )
VAR _player =
    VALUES ( 'table'[player] )
VAR _field =
    VALUES ( 'table'[field] )
VAR _values =
    VALUES ( 'table'[values] )
RETURN
    CROSSJOIN ( _name, _player, _field, _values )

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.