cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Calcular las ventas del mes del año anterior hasta la fecha

Hola

Estoy luchando para que el cálculo de MTD del año anterior funcione, y estoy tratando de obtener el mes del año anterior hasta la fecha, que es solo agosto de 2021. ¿Cómo reviso la siguiente fórmula para el año pasado?

Esta es mi fórmula para obtener el MTD actual

CURRENT_MTD = CALCULATE(SUM(Data[Sales_Amount]), FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 01)), FILTER(Data, Data[FISCAL_DATE] < TODAY()))

Aquí está el resultado

Capture.PNG

Gracias bunch

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Lo descubrí yo mismo

CALCULATE(SUM(Data[Sales_Amount]), 
                FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
                FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)), 
                FILTER(Data, Data[FISCAL_DATE] < TODAY())
            )

Resultado

Capture.PNG

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Lo descubrí yo mismo

CALCULATE(SUM(Data[Sales_Amount]), 
                FILTER(Data, Data[FISCAL_DATE] <= DATE(YEAR(TODAY())-1, MONTH(TODAY()), DAY(TODAY()))),
                FILTER(Data, Data[FISCAL_DATE] >= DATE(YEAR(TODAY())-1, MONTH(TODAY()), 01)), 
                FILTER(Data, Data[FISCAL_DATE] < TODAY())
            )

Resultado

Capture.PNG

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.