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
henryco88
Helper II
Helper II

Columna total al principio de la tabla de matriz

Hola

¿Cómo puedo poner la columna total al principio de la tabla de matriz?

henryco88_0-1606916353173.png

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

No @henryco88,

Según mi prueba, actualmente no se admite en Power BI. Puede votar esta idea similar: Tabla / Matriz: Columna total en la primera posición.

Además, puede intentar alcanzar sus requisitos de la siguiente manera:

Tabla de muestra:

Categoría Subcategoría Valor
A a1 1
A a2 2
A a3 3
B b1 4
B B2 5
B b3 6

1. Cree una tabla.

Table 2 =
VAR t1 =
    DISTINCT ( 'Table'[SubCategory] )
VAR t2 =
    ADDCOLUMNS ( t1, "Order", RANKX ( t1, [SubCategory],, ASC, DENSE ) + 1 )
VAR t3 =
    DATATABLE ( "Total", STRING, "Order", INTEGER, { { "Total", 1 } } )
RETURN
    UNION ( t3, t2 )

table2.JPG

relationship.JPG

2. Cree una medida.

Measure = 
VAR a =
    SELECTEDVALUE ( 'Table 2'[Total] )
RETURN
    IF (
        a = "Total",
        CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( ALLEXCEPT ( 'Table', 'Table'[Category] ), 'Table'[SubCategory] = a )
        )
    )

3. Cree un objeto visual de matriz.

matrix visual.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

2 REPLIES 2
Icey
Community Support
Community Support

No @henryco88,

Según mi prueba, actualmente no se admite en Power BI. Puede votar esta idea similar: Tabla / Matriz: Columna total en la primera posición.

Además, puede intentar alcanzar sus requisitos de la siguiente manera:

Tabla de muestra:

Categoría Subcategoría Valor
A a1 1
A a2 2
A a3 3
B b1 4
B B2 5
B b3 6

1. Cree una tabla.

Table 2 =
VAR t1 =
    DISTINCT ( 'Table'[SubCategory] )
VAR t2 =
    ADDCOLUMNS ( t1, "Order", RANKX ( t1, [SubCategory],, ASC, DENSE ) + 1 )
VAR t3 =
    DATATABLE ( "Total", STRING, "Order", INTEGER, { { "Total", 1 } } )
RETURN
    UNION ( t3, t2 )

table2.JPG

relationship.JPG

2. Cree una medida.

Measure = 
VAR a =
    SELECTEDVALUE ( 'Table 2'[Total] )
RETURN
    IF (
        a = "Total",
        CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) ),
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER ( ALLEXCEPT ( 'Table', 'Table'[Category] ), 'Table'[SubCategory] = a )
        )
    )

3. Cree un objeto visual de matriz.

matrix visual.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.

amitchandak
Super User
Super User

@henryco88 , Dudo que tal opción para el total de la columna

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.