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

Secuencia por varias columnas

Necesito poder secuenciar mis datos usando la secuencia actual, pero totalizando la columna "QuantityToBuild" agrupando por la columna "Component".

Así que en otras palabras, necesitaría la secuencia 1 y 2 para ser etiquetado como "1", Componente "2128", y el QuantityToBuild "336". Ir a la secuencia "2", Componente "631", QuantityToBuild "224", y así sucesivamente..

Aquí están mis datos actualmente como están:

SecuenciaItemNumberComponenteQuantityToBuildFecha
117821282245/11/2020 0:00
217921281125/11/2020 0:00
322706312245/11/2020 0:00
41822128565/11/2020 0:00
51832128565/11/2020 0:00
622716312245/11/2020 0:00
7848584891125/11/2020 0:00
8848484895045/11/2020 0:00
918121281685/11/2020 0:00
103108924905/11/2020 0:00
1164139452565/11/2020 0:00
123107924905/11/2020 0:00
1364129452565/11/2020 0:00
143109924305/11/2020 0:00

Aquí es cómo espero que mis datos se vean:

SecuenciaComponenteQuantityToBuildFecha
121283365/11/2020 0:00
26312245/11/2020 0:00
321281125/11/2020 0:00
46312245/11/2020 0:00
584896165/11/2020 0:00
621281685/11/2020 0:00
7924905/11/2020 0:00
89452565/11/2020 0:00
9924905/11/2020 0:00
109452565/11/2020 0:00
11924305/11/2020 0:00
1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hola @kelly4dm ,

Podemos crear una tabla calculada para satisfacer sus necesidades:

Table 2 =
VAR temp =
    ADDCOLUMNS (
        'Table',
        "MinS",
        VAR s = [Sequence]
        VAR C = [Component]
        RETURN
            MINX (
                FILTER (
                    'Table',
                    VAR c1 = [Component]
                    VAR s1 = [Sequence]
                    RETURN
                        CALCULATE (
                            COUNTROWS ( 'Table' ),
                            FILTER (
                                ALL ( 'Table' ),
                                'Table'[Component] = c1
                                    && 'Table'[Sequence] <= s
                                    && 'Table'[Sequence] >= s1
                            )
                        ) = s - s1 + 1
                ),
                [Sequence]
            )
    )
RETURN
    SELECTCOLUMNS (
        SUMMARIZE (
            temp,
            [MinS],
            "Sequence", RANKX ( temp, [MinS],, ASC, DENSE ),
            "Component", MAX ( 'Table'[Component] ),
            "QuantityToBuild", SUM ( 'Table'[QuantityToBuild] ),
            "Date", MAX ( 'Table'[Date] )
        ),
        "Sequence", [Sequence],
        "Component", [Component],
        "QuantityToBuild", [QuantityToBuild],
        "Date", [Date]
    )

15.jpg


Por cierto, pbIX archivo como adjunto.


Saludos

Community Support Team _ Dong Li
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

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hola @kelly4dm ,

Podemos crear una tabla calculada para satisfacer sus necesidades:

Table 2 =
VAR temp =
    ADDCOLUMNS (
        'Table',
        "MinS",
        VAR s = [Sequence]
        VAR C = [Component]
        RETURN
            MINX (
                FILTER (
                    'Table',
                    VAR c1 = [Component]
                    VAR s1 = [Sequence]
                    RETURN
                        CALCULATE (
                            COUNTROWS ( 'Table' ),
                            FILTER (
                                ALL ( 'Table' ),
                                'Table'[Component] = c1
                                    && 'Table'[Sequence] <= s
                                    && 'Table'[Sequence] >= s1
                            )
                        ) = s - s1 + 1
                ),
                [Sequence]
            )
    )
RETURN
    SELECTCOLUMNS (
        SUMMARIZE (
            temp,
            [MinS],
            "Sequence", RANKX ( temp, [MinS],, ASC, DENSE ),
            "Component", MAX ( 'Table'[Component] ),
            "QuantityToBuild", SUM ( 'Table'[QuantityToBuild] ),
            "Date", MAX ( 'Table'[Date] )
        ),
        "Sequence", [Sequence],
        "Component", [Component],
        "QuantityToBuild", [QuantityToBuild],
        "Date", [Date]
    )

15.jpg


Por cierto, pbIX archivo como adjunto.


Saludos

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

haga clic en el campo de componente, luego haga clic en la tabla de modelado en la cinta de opciones de menú y en las herramientas de columna haga clic en ordenar por columna, a continuación, puede utilizar la columna de secuencia para ordenar el campo de componente

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.