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
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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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