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

Añadir dimensión dentro de la unión addcolumn

¡Hola!

Hice 2 tablas de dimensiones manuales, denominadas "Empresa" y "Equipos".

También hizo una tabla calculada como se muestra a continuación. Con esta tabla puedo combinar 'Ventas' y 'Costes' dentro de la misma tabla.

Pero, para 'Costos' me gustaría una columna como subdimensión 'Equipos'. Desgraciadamente, no puedo hacer que esto funcione 🤦.

Me gustaría lograr esto sin usar relaciones entre tablas.

Espero que esto tenga sentido y alguien sea capaz de ayudarme! Muchas gracias.

Facts = 
UNION(
    ADDCOLUMNS(
        'Company';
        "Type"; "Sales";
        "Team"; "";
        "TestMeasure"; ... 
    );
        ADDCOLUMNS(
        'Company';
        "Type"; "Costs";
        "Team"; "🤦‍";
        "TestMeasure"; ...
))

Resultado deseado:

EmpresaTipoEquipo
AVentas
BVentas
ACostos1
BCostos1
ACostos2
BCostos2
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hola @PVO1

Podría usar esta fórmula como se muestra a continuación:

Table = 
UNION(
    ADDCOLUMNS(
        'Company',
        "Team", "",
        "Type", "Sales",
        "TestMeasure", TODAY()
    ),
        ADDCOLUMNS(
        GENERATE('Company',FILTER(Team,Team[Team]<>3)),
        "Type", "Costs",
        
        "TestMeasure", NOW()
))

Resultado:

5.JPG

saludos

Lin

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

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hola @PVO1

Podría usar esta fórmula como se muestra a continuación:

Table = 
UNION(
    ADDCOLUMNS(
        'Company',
        "Team", "",
        "Type", "Sales",
        "TestMeasure", TODAY()
    ),
        ADDCOLUMNS(
        GENERATE('Company',FILTER(Team,Team[Team]<>3)),
        "Type", "Costs",
        
        "TestMeasure", NOW()
))

Resultado:

5.JPG

saludos

Lin

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

¡Muchas gracias!

La aplicación de la función generate es lo que estaba buscando.

Incluso filtraste el equipo 3 de mi ejemplo para obtener el resultado deseado 😉

amitchandak
Super User
Super User

@PVO1 , Debería funcionar dando nombre de columna como

Facts = 
UNION(
    selectCOLUMNS(Table1,"Company";
        Table[Company];
        "Type"; "Sales";
        "Team"; "";
        "TestMeasure"; ... 
    );
        selectCOLUMNS(Table1,"Company";
        Table[Company];
        "Type"; "Costs";
        "Team"; Table[Team];
        "TestMeasure"; ...
))

@amitchandak gracias por su respuesta!

Tal vez me falta algo, pero addcolumns espera una expresión. Table[team] no es una expresión.

Intenté muchas expresiones diferentes, pero no soy capaz de encontrar la correcta.

El mejor que encontré fue RELACIONADO('Equipo'[Equipo]). Desafortunadamente esto dio el resultado a continuación.

EmpresaTipoEquipo
AVentas
BVentas
ACostos1
BCostos2

@PVO1 , puede compartir datos de origen. Ya ha compartido la salida deseada

https://drive.google.com/open?id=1j9UOmy1cjbrjXREJSoY-_elkrwxj2ACX

Si es necesaria una relación entre tablas, no dude en sugerir.

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.