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
dollarvora
Helper I
Helper I

Valor de búsqueda correspondiente a la fecha máxima y concatenar

Tengo dos tablas como debajo:

Orden:

IdFechaPropósito
101-02-2020A
103-03-2020B
103-03-2020C
202-02-2020A
201-02-2020D
202-02-2020E
304-05-2020X
304-05-2020Y
304-05-2020Z
401-01-2020M
506-07-2020N

Cliente:

Id
1
2
3
4
5
6

Quiero hacer coincidir los ID y extraer la fecha máxima para cada ID y también concatenar los PROPÓSITOs para esos ID

por lo que la tabla resultante será como en:

IdMAX_DATEPropósito
103-03-2020B,C
202-02-2020A,E
304-05-2020X,Y,Z
401-01-2020M
506-07-2020N
6

Actualmente, para obtener la columna de fecha máxima estoy usando la siguiente consulta:

MAX_DATE de la casa de los 20o
VAR _MaxDate ?
CALCULAR (
MAX ( PEDIDO[FECHA] ),
FILTRO ( ORDER,ORDER[ID] Á CUSTOMER[ID] )
)
devolución
LOOKUPVALUE (
PEDIDO[FECHA],
ORDEN[FECHA], _MaxDate,
PEDIDO[ID], CLIENTE[ID]

No estoy seguro de cómo puedo concatenar la columna PURPOSE usando la misma o similar medida

1 REPLY 1
edhans
Super User
Super User

Utilizaría la función CONCATENATEX(). Los conceptos básicos son


Measure =
CONCATENATEX(
    TableName,
    ColumnOrExpression,
    ", "
)

Hay un excelente artículo aquí usando CONCATENATEX() para depurar medidashttps://dax.tips/2020/06/24/dax-1-column-fusion-pt-2/#:~:text=Iterator%20functions%20can%20be%20powe... . Phil estuvo en nuestro grupo de usuarios de PowerPlatform la semana pasada y mostró este truco. Muy guay.

CONCATENATEX tomará fácilmente un montón de texto y lo armará en cualquier orden que desee con el delimitador que elija.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.