Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

LTM in column

Good

I have a little doubt I would want to transform a measure into a calculated column but it does not give me the expected values:

Total acumulado de Horas Curso en ID_PERIODO = 
CALCULATE(
 SUM('FORMACION'[Horas Curso]);
 FILTER(
  ALLSELECTED('Maestra Fechas'[FECHA]);
  'Maestra Fechas'[FECHA] in DATESINPERIOD('Maestra Fechas'[FECHA_PERI]; MAX('Maestra Fechas'[FECHA]);-12; MONTH
)))


My column is:

Columna=
CALCULATE(
 SUM('FORMACION'[Horas Curso]);
 FILTER(
  ALLSELECTED('Maestra Fechas'[FECHA]);
  'Maestra Fechas'[FECHA] in DATESINPERIOD('Maestra Fechas'[FECHA]; MAX('Maestra Fechas'[FECHA]);-12; MONTH
)))


The result is as follows:
Screenshot_8.png
Why don't the same values appear in my column that I should put to make it the same?

9 Replies

  • Anonymous , your formula seems fine. But it should a measure not column.


    Example measures

    Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD(Table[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
    Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD(Table[Date Filer],MAX(Sales[Sales Date]),-12,MONTH))

    • Anonymous's avatar
      Anonymous
      Not applicable

      I know my measurement is fine, I put the photograph to be observed. I want that measure turned into a column

      • Icey's avatar
        Icey
        Community Support

        Hi Anonymous ,

         

        Try this:

        Columna =
        CALCULATE (
            SUM ( 'FORMACION'[Horas Curso] );
            FILTER (
                ALLSELECTED ( 'Maestra Fechas'[FECHA] );
                'Maestra Fechas'[FECHA]
                    IN DATESINPERIOD (
                        'Maestra Fechas'[FECHA_PERI];
                        'Maestra Fechas'[FECHA];
                        -12;
                        MONTH
                    )
            )
        )
        

         

        If it doesn't work, please share me a dummy pbix file for test, only with necessary part, removing sensitive information and replacing real data with dummy data. It is suggested to upload your file to OneDrive for Business and then paste the link here.

         

         

        Best Regards,

        Icey

         

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