Forum Discussion

roxanahd1993's avatar
roxanahd1993
New Member
2 years ago

Acumulado

Buenas tardes necesito apoyo para cálcular el acumulado de una medida, ya hice el cálcula y arrojo los datos correctos pero al hacer un nuevo acumulado con otra medida los valores que arroja no son los correctos

La primera columna es una medida y su acumulado pueden observar que es correcto sin embargo en la tercera columna hay una nueva mededida pero su acumulado que esta a un costado no es correcto

 

Formula utilizada en el primer acumulado

MCI Plant Acum = CALCULATE( [MCI Plant],
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('FECHA', 'Fecha'[Mes#], 'FECHA'[Mes]),
            ALLSELECTED('FECHA')
        ),
        ISONORAFTER(
            'Fecha'[Mes#], MAX('Fecha'[Mes#]), DESC,
            'FECHA'[Mes], MAX('FECHA'[Mes]), DESC
        )
    )
)
 
Formula del segundo acumulado
MEI Plant Acum = CALCULATE( [MEI Plant1],
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('Fecha','Fecha'[Mes#], 'Fecha'[Mes]),
            ALLSELECTED('Fecha')
        ),
        ISONORAFTER(
            'Fecha'[Mes#], MAX('Fecha'[Mes#]), DESC,
            'Fecha'[Mes], MAX('Fecha'[Mes]), DESC
        )
    )
)
 
Sabran proque en una muestra el reseultado correcto y en el otro no? o que formula deberia utilizar para que sea correcta.
 
Quedo pendiente, gracias

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi roxanahd1993 ,
    We can try to simplify your code a little bit, because due to the application of calculatetable and isonorafter it is possible to cause errors in the contextual termination or accumulation logic.

     

    MEI Plant Acum(Copy) = 
    CALCULATE(
       SUM('Fecha'[MEI Plant1]),
       FILTER(
           ALLSELECTED('Fecha'),
        'Fecha'[Mes#] <= MAX('Fecha'[Mes#])
       )
    )

     


    It is also possible that my data is too simple to fulfil your needs, you can upload some example data or PBIX files that might be helpful in solving your problem!

    I hope that my solution will solve your problem and I will be extremely proud if it does!

    Best regards,
    Community Support Team_ Tom Shen

     

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

     

     

  • Buen día

     

    Inyente utilizar la formula mas no me permite, esto es posible que pase porque es una medida y no una tabla?

     

    Quedo pendiente ya que llevo varios días intentandolo 😞

     

    Prueba.pbix

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi roxanahd1993 ,
      I'm sorry I can't open your pbix file due to environmental constraints, the public forum can't open your private files, you can collate some example data and re-post it to the public cloud, this will better help you solve the problem, looking forward to your reply!

      Best regards,
      Community Support Team_ Tom Shen

       

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