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
ChoiJunghoon
Helper III
Helper III

[DAX] Cómo añadir la Tabla A/B

Untitled.png

Quiero crear "NewTable".

Solo puedo usar código DAX.

¿Podrías ayudarme....

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hola @ChoiJunghoon ,

Puede crear una tabla calculada como DAX a continuación.

Table3 =

var _Table= EXCEPT(VALUES(Table2[Date]),VALUES(Table1[Date]))

return

UNION(SUMMARIZE(Table1,Table1[Date],"Value", SUM(Table1[Value])),

SUMMARIZE(_Table, [Date],"Value", SUM(Table2[Value])) )

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

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

View solution in original post

8 REPLIES 8
v-xicai
Community Support
Community Support

Hola @ChoiJunghoon ,

¿Tiene sentido? Si es así, marque amablemente la respuesta adecuada como una solución para ayudar a otros que tienen el problema similar y cerrar el caso. Si no, avísame y trataré de ayudarte más.

Saludos

Amy

v-xicai
Community Support
Community Support

Hola @ChoiJunghoon ,

Puede crear una tabla calculada como DAX a continuación.

Table3 =

var _Table= EXCEPT(VALUES(Table2[Date]),VALUES(Table1[Date]))

return

UNION(SUMMARIZE(Table1,Table1[Date],"Value", SUM(Table1[Value])),

SUMMARIZE(_Table, [Date],"Value", SUM(Table2[Value])) )

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

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

Ashish_Mathur
Super User
Super User

Hola

En el Editor de consultas, anexe las dos tablas. Al objeto visual, arrastre la columna Fecha del conjunto de datos anexado y escriba esta medida

•SUM(Datos[Valor])

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Lo siento, sólo tengo que usar la función DAX.

Porque, yo uso la consulta directa.
y ya he hecho este informe.

mahoneypat
Employee
Employee

Por favor, pruebe esta expresión para su tabla

New Table =
VAR __Table2 =
    SELECTCOLUMNS ( Table2, "Date", Table2[Date], "Value", Table2[Value] )
VAR __Table1 =
    SELECTCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE ( Table1, Table1[Date] ),
            "@Value", CALCULATE ( SUM ( Table1[Amount] ) )
        ),
        "Date", [Date],
        "Value", [@Value]
    )
RETURN
    UNION ( __Table2, __Table1 )

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Gracias por su respuesta.

Pero tu respuesta es la brecha con lo que quiero.

A0
B0
C0
D0
A15
B15
D13

Quiero eliminar los datos de duplicación..

Quiero crear "Nueva Tabla"

A15
B15
C0
D13

Es mi culpa. Olvidé esa parte. Por favor, prueba éste. No puse sus datos en un modelo, así que no puedo confirmarme.

New Table =
VAR __Table2 =
    SELECTCOLUMNS ( Table2, "Date", Table2[Date], "Value", Table2[Value] )
VAR __Table1 =
    SELECTCOLUMNS (
        ADDCOLUMNS (
            SUMMARIZE ( Table1, Table1[Date] ),
            "@Value", CALCULATE ( SUM ( Table1[Amount] ) )
        ),
        "Date", [Date],
        "Value", [@Value]
    )
VAR __unioned =
    UNION ( __Table2, __Table1 )
RETURN
    SUMMARIZE ( __unioned, [Date], "Value", SUM ( [Value] ) )

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


NewTable ??
Ser _Table2 ?
SELECTCOLUMNS(Table2,"Date",Table2[Date],"Value",Table2[Value])
Donde _Table1 ?
SELECTCOLUMNS(
ADDCOLUMNS(SUMMARIZE(Table1,Table1[Date]),
"@Value",CALCULATE(SUM(Table1[Value]))
),"Fecha",[Fecha]
,"Valor",[@Value])

Var _unioned-UNION(_Table2,_Table1)
devolución
RESUMEN(_unioned,[Fecha],"Valor",SUM([Valor]))


sum[Value] es error " No se puede identificar la tabla que contiene la columna [Value]."

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.