Forum Discussion

RMC_Candy's avatar
RMC_Candy
New Member
3 years ago
Solved

DATOS duplicados

tengo dos tablas relacionadas con id

Fecha ubicación ID
20230706 Pasillo juguetes 111820230706155000
20230706 Pasillo central 111820230706133000
20230707 Pasillo central 111820230707104000
20230708 Pasillo juguetes 111820230 706156000

mediante la formula MAXX obtuve que me salga la ultima fecha de chequeo de la ubicacion

20230707 Pasillo central

20230708 Pasillo Juguetes.

 

Ahora el problema es que tengo otra tabla donde me pone los chequeos de articulos con su id.

ID Artículo Cantidad
111820230706155000 1 1
111820230706155000 2 3
111820230706133000 5 2
111820230706133000 7 2
111820230707104000 1 2 1 1
1820230707104000 2 1

el problema lo tengo en que me suma el total de cada ubicacion

20230707 Pasillo central xtotal 

20230708 Pasillo Juguetes. xtotal 

cuando lo que yo quiero es que solamente me sume el total del chequeo de fecha MAXX.

 

¿me pueden indicar?

gracias

  • Hi RMC_Candy ,

     

    Please try:

    Total = 
    SUMX(SUMMARIZE('Table','Table'[ubicación],"Date",MAX('Table'[Fecha]),"Value",CALCULATE(SUM('Table (2)'[Cantidad]),FILTER('Table (2)',[ID]=MAX('Table'[ID])))),[Value])

    Final output:

    Best Regards,

    Jianbo Li

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

1 Reply

  • Hi RMC_Candy ,

     

    Please try:

    Total = 
    SUMX(SUMMARIZE('Table','Table'[ubicación],"Date",MAX('Table'[Fecha]),"Value",CALCULATE(SUM('Table (2)'[Cantidad]),FILTER('Table (2)',[ID]=MAX('Table'[ID])))),[Value])

    Final output:

    Best Regards,

    Jianbo Li

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