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
Syndicate_Admin
Administrator
Administrator

Calcular el valor acumulado con dax

Creé una nueva medida para calcular las cantidades acumuladas
La medida calcula los valores hasta final de año pero lo que quería era que el cálculo se hiciera solo hasta el mes actual o hasta la fecha máxima que encuentre.

Cantidades acumuladas =
SI(
ISFILTERED('Base de datos'[Fecha]),
ERROR("Fecha principal."),
TOTALYTD(SUMA('Base de Datos'[Cantidad]), 'Base de Datos'[Fecha].[ Fecha])
)

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Probar:

Cumulative value =
IF (
    MAX ( Database[Data].[Date] ) < TODAY (),
    CALCULATE (
        SUM ( Database[Preço Líquido (MBase)] ),
        FILTER (
            ALL ( 'Database' ),
            Database[Data].[Date] <= MAX ( Database[Data].[Date] )
        )
    )
)

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Probar:

Cumulative value =
IF (
    MAX ( Database[Data].[Date] ) < TODAY (),
    CALCULATE (
        SUM ( Database[Preço Líquido (MBase)] ),
        FILTER (
            ALL ( 'Database' ),
            Database[Data].[Date] <= MAX ( Database[Data].[Date] )
        )
    )
)

gracias por tu ayuda mi amigo

Tomé parte de la fórmula que me enviaste y fue así

Precio neto (MBase) YTD =
SI (MÁXIMO ( Base de datos[Datos].[Fecha] ) < HOY (), SI(
ISFILTERADO('Base de datos'[Datos]),
ERROR("Fecha principal".),
TOTALYTD(SUMA(«Base de datos»[Precio neto (MBase)]), 'Base de datos'[Datos].[Fecha])
))
Syndicate_Admin
Administrator
Administrator

@ngomes , Ejemplo con ayuda de date tbale

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

o

calculate(SUM('Database'[Quantity]), filter(allselected('Database') , 'Database'[Date] <= max('Database'[Date]) )

o

calculate(SUM('Database'[Quantity]), filter(all('Database') , 'Database'[Date] <= max('Database'[Date]) ) )

Ya he probado las fórmulas, pero sigo teniendo el mismo problema
fíjate en el ejemplo que pongo
en diciembre no tengo valores y la suma va de noviembre a diciembre

calcular(SUMA(Base de datos[Precio neto (MBase)]), filtro(todo('Base de datos') , Base de datos[Datos].[Fecha] <= Máximo(Base de datos[Datos].[Fecha]) ) )
Sem Título.jpg

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.