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
ciken
Resolver I
Resolver I

Comparar MTD con el mismo período del año pasado

Tratando de construir una tabla MTD que me mostrará cómo estoy haciendo a través del día actual en el mes actual vs el mismo período de tiempo exacto el año pasado (es decir, del 1 al 10 de agosto de 2020 vs del 1 al 10 de agosto de 2019). Cuando escribo mi DAX, no importa cuántas maneras diferentes intento, termino con el mes completo de agosto de 2019 en comparación y no puedo averiguar cómo hacer que sólo me muestre las fechas específicas que estoy buscando. Soy positivo (como verán a continuación) mi empresa no seel $1m en ingresos durante el primer día de 10, así que agosto de 2019. A continuación se muestran mis fórmulas DAX y una captura de pantalla de mi tabla. He probado SAMEPERIODLASTYEAR que tampoco funciona. Cualquier pensamiento son apreciados!!

¡Gracias por la ayuda!

Ventas MTD á CALCULATE([Total Revenue],DATESMTD('Calendar'[Date]))
VENTAS LY - CALCULATE([Total Revenue],DATEADD('Calendar'[Date],-1,YEAR))
MTD Last Year ? CALCULATE([SALES LY],DATESMTD('Calendar'[Date]))
Dax Question.png
1 ACCEPTED SOLUTION

@ciken pena aquí es la medida para el último año, utilizando la medida existente que compartí con usted

Revenue MTD PY = 
VAR __today = TODAY()
VAR __lastYear = EDATE ( __today, -12 )
RETURN
CALCULATE (
    [Revenue MTD],
    SAMEPERIODLASTYEAR ( 'Dim Calendar'[Date] ),
    'Dim Calendar'[Date] <= __lastYear
)

Me gustaría elogios si mi solución ayudara. 👉 Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@ciken , Probar como

MTD QTY forced= 
var _max = today()
return
calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),'Date'[Date]<=_max)


LMTD QTY forced= 
var _max = date(year(today())-1,month(today()),day(today()))
return
CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)

Esto sucede cuando se ve por mes año, para el año pasado obtiene la fecha de fin de mes.

@ciken pena aquí es la medida para el último año, utilizando la medida existente que compartí con usted

Revenue MTD PY = 
VAR __today = TODAY()
VAR __lastYear = EDATE ( __today, -12 )
RETURN
CALCULATE (
    [Revenue MTD],
    SAMEPERIODLASTYEAR ( 'Dim Calendar'[Date] ),
    'Dim Calendar'[Date] <= __lastYear
)

Me gustaría elogios si mi solución ayudara. 👉 Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Greg_Deckler
Super User
Super User

Puede encontrar esto útil - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

También, ver si mi Inteligencia del Tiempo el Camino Duro proporciona una manera diferente de lograr lo que está buscando.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
parry2k
Super User
Super User

@ciken intentar seguir la medida

Revenue MTD = 
CALCULATE ( 
    [Total Revenue], 
    DATESMTD ( 
        CALCULATETABLE ( 
            VALUES ( 'Calendar'[Date] ), 
            KEEPFILTERS ( 'Calendar'[Date] <= TODAY() ) 
        )
    ) 
)

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Gracias @parry2k , Esto me dio el MTD para este año, pero no el año pasado.

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.