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
Luizcarlospf
Helper I
Helper I

Análisis combinatorio entre las filas de una tabla

Hola, me gustaría saber si hay alguna función para hacer el análisis combinatorio entre todas las filas de una tabla.

Por ejemplo, cada línea representa los datos de rendimiento de un algoritmo determinado. Necesito encontrar la mejor combinación de algoritmos para tener una solución más rápida

Obs: Tengo 10 algoritmos y hago una combinación de 5 en 5 hasta que encuentre la mejor combinación

1 ACCEPTED SOLUTION

No @Luizcarlospf,

Prueba esto:

Combinaton Table = 
SUMMARIZE (
    ADDCOLUMNS (
        FILTER (
            ADDCOLUMNS (
                GENERATE (
                    SUMMARIZE (
                        'Table',
                        'Table'[algorithm],
                        'Table'[functions],
                        'Table'[Values]
                    ),
                    GENERATE (
                        SELECTCOLUMNS (
                            DISTINCT (
                                FILTER (
                                    'Table',
                                    'Table'[functions] = EARLIER ( 'Table'[functions] )
                                )
                            ),
                            "algorithm1", [algorithm],
                            "value1", [Values]
                        ),
                        SELECTCOLUMNS (
                            DISTINCT (
                                FILTER (
                                    'Table',
                                    'Table'[functions] = EARLIER ( 'Table'[functions] )
                                        && [algorithm] <> EARLIER ( 'Table'[algorithm] )
                                )
                            ),
                            "algorithm2", [algorithm],
                            "value2", [Values]
                        )
                    )
                ),
                "_unique", COUNTROWS ( DISTINCT ( { [algorithm], [algorithm1], [algorithm2] } ) )
            ),
            [_unique] = 3
        ),
        "Combination", CONCATENATEX ( { [algorithm], [algorithm1], [algorithm2] }, [Value], " + " ),
        "Sum_",
            [Values] + [value1] + [value2]
    ),
    [Combination],
    [functions],
    [Sum_]
)

combination.JPG

Saludos

Icey

Si este post ayuda, entonces considere Aceptarlo como la solución para ayudar a otros miembros a encontrarlo más rápido.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Estoy enviando una imagen adjunta para explicarlo mejor.

Sem título.png

Por ejemplo. Tengo columnas que muestran el rendimiento de cada función del algoritmo y tengo que hacer combinaciones para encontrar la mejor solución.

¿Puedo hacer esta combinación con PowerBI o simplemente usando Python en PowerBi?

No @Luizcarlospf,

Prueba esto:

Combinaton Table = 
SUMMARIZE (
    ADDCOLUMNS (
        FILTER (
            ADDCOLUMNS (
                GENERATE (
                    SUMMARIZE (
                        'Table',
                        'Table'[algorithm],
                        'Table'[functions],
                        'Table'[Values]
                    ),
                    GENERATE (
                        SELECTCOLUMNS (
                            DISTINCT (
                                FILTER (
                                    'Table',
                                    'Table'[functions] = EARLIER ( 'Table'[functions] )
                                )
                            ),
                            "algorithm1", [algorithm],
                            "value1", [Values]
                        ),
                        SELECTCOLUMNS (
                            DISTINCT (
                                FILTER (
                                    'Table',
                                    'Table'[functions] = EARLIER ( 'Table'[functions] )
                                        && [algorithm] <> EARLIER ( 'Table'[algorithm] )
                                )
                            ),
                            "algorithm2", [algorithm],
                            "value2", [Values]
                        )
                    )
                ),
                "_unique", COUNTROWS ( DISTINCT ( { [algorithm], [algorithm1], [algorithm2] } ) )
            ),
            [_unique] = 3
        ),
        "Combination", CONCATENATEX ( { [algorithm], [algorithm1], [algorithm2] }, [Value], " + " ),
        "Sum_",
            [Values] + [value1] + [value2]
    ),
    [Combination],
    [functions],
    [Sum_]
)

combination.JPG

Saludos

Icey

Si este post ayuda, entonces considere Aceptarlo como la solución para ayudar a otros miembros a encontrarlo más rápido.

Thank you very much!

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.