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

¿Cómo obtener valores distintos cuando se unen dos tablas mediante Union?

Hola

Tengo dos tablas, donde la tabla A tiene valores únicos y las tablas B (dinámicamente actualizadas) siempre contendrán algunos registros de la tabla A. Tabla A

1.png

Tabla B

2.png

Cuando hago UNION, obtengo filas duplicadas.

5.png

También he intentado usar

Unión-DISTINCT(UNION('TABLE 2'[Date]),VALUES('Table 1'[Date]))) Pero solo puedo extraer una sola columna con valores distintos.
4.png
Necesito todas las columnas Fechas, Abierto, Alto, Bajo, etc. sin filas duplicadas.
¿Alguien puede ayudarme con esto?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sandesh043

Esto se debe a que los valores altos y bajos abiertos tienen alguna diferencia.

Utilice Resumir y tomar min y máximo de eso

Trate como

resumir(UNION(VALUES('Table 2'),VALUES('Table 1')),[Date],"Open",max([Open]),"Low",min([Low]),"High",max([High]))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sandesh043

Esto se debe a que los valores altos y bajos abiertos tienen alguna diferencia.

Utilice Resumir y tomar min y máximo de eso

Trate como

resumir(UNION(VALUES('Table 2'),VALUES('Table 1')),[Date],"Open",max([Open]),"Low",min([Low]),"High",max([High]))

UNION en DAX es lo mismo que UNIONALL en SQL. Envuelva todo el asunto dentro de DISTINCT()



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.