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
Snip
Helper II
Helper II

Añadir columna con el mismo cálculo

neeHi

¡Espero que algún cuerpo pueda ayudarme!

Tengo 2 tablas, una con fechas y otra con valores, están conectadas.

A continuación, qué calcular la suma del último mes e insertar el valor en una columna y el mismo valor para cada fila.

Así que mis datos podrían parecerse a:

FechaValor
2020-01-015
2020-01-108
2020-01-1588
2020-01-209
2020-01-3055
2020-02-08654
2020-02-1885
2020-02-251

La suma del último mes es 740 Me gustaría tener una nueva columna hay sólo 740 para cada fila. Como abajo

FechaValorTotal
2020-01-015740
2020-01-108740
2020-01-1588740
2020-01-209740
2020-01-3055740
2020-02-08654740
2020-02-1885740
2020-02-251740

Espero que algún cuerpo pueda ayudarme a 🙂

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Snip , Crear una nueva columna como

Column = sumx(FILTER('Table',EOMONTH([date],0) =EOMONTH(max([Date]),0)),[Value])

View solution in original post

v-xuding-msft
Community Support
Community Support

Hola @Snip ,

Por favor, intente esto:

Measure =
VAR mon_ =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Date' ),
            'Date'[Month] = MONTH ( mon_ )
                && MAX ( 'Table'[Value] ) <> BLANK ()
        )
    )

v-xuding-msft_0-1602148852901.png

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

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hola @Snip ,

Por favor, intente esto:

Measure =
VAR mon_ =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Date' ),
            'Date'[Month] = MONTH ( mon_ )
                && MAX ( 'Table'[Value] ) <> BLANK ()
        )
    )

v-xuding-msft_0-1602148852901.png

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Snip , Crear una nueva columna como

Column = sumx(FILTER('Table',EOMONTH([date],0) =EOMONTH(max([Date]),0)),[Value])

No funciona. ¿Puedes explicar lo que hace?

Remeber tengo una tabla de fechas y una tabla con los valores.

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.