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
Anonymous
Not applicable

YTD y YTD El año pasado dax cuando el presupuesto no es fijo.

Hola a todos

Quiero calcular YTD y YTD el año pasado cuando mi presupuesto no es fijo :

Fecha de finalización de la fecha de inicio del año

Por ejemplo: Fy19 03.09.2018 01.09.2019

Fy20 02.09.2019 30.08.2020

Fy21 31.08.2020 29.08.2021

Las funciones integradas no funcionan aquí. Cualquier ayuda es apreciada.

Gracias de antemano!

@amitchandak @Greg_Deckler

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@dgarg_94


Primero debe transformar la tabla de datos y, a continuación, relacionar las tablas FY con Date.

Deberías tener una tabla de calendario.

Tabla: CALENDAR(DATE(2019,1,1),DATE(2021,12,31))
A continuación, debe tener una tabla para cada ejercicio, incluida una columna de fecha y una columna de ventas. Por ejemplo:
Tabla para el año 2019
Fecha Ventas
2019.1.1 20
2019.1.31 33
2019.2.3 20
...
saludos
Paul
amitchandak
Super User
Super User

@dgarg_94 , Crear un calendario de fechas

calendario(fecha(2018,09,03), Fecha(2021,08,29)) //Parece un año de 364 días, se puede establecer con la fecha de inicio

Ahora actualiza ese año ?

Fecha de inicio: maxx(filter(FYDate[Fecha]<-FY[Fecha de finalización] && Fecha[Fecha]>'FY[Fecha de inicio]),[Fecha de inicio])

De la misma manera Copiar las fechas

año Seq -Quotient(datediff(min(Date[Date]), Date[Date],day),364) //This will create year as 0, 1,2,4,

FY á Año(Min(Fecha[Fecha])) +Año Seq

Ahora puede comenzar el final de la fecha, etc.

Crear una fecha de inicio del ranking del año o utilizar el año de sí mismo para Time Intelligence

Este año: CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])))
Last Year ? CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])-1))

Rango de año RANKX(all('Date'),'Date'[Year Start date],,ASC,Dense)
Este año: CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]-max('Date'[Year Rank])))
Last Year ? CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]-max('Date'[Year Rank])-1))

Para YTD

Día del año :datediff([Year Start date] , [Date],Day) +1

YTDTM CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]-max('Date'[Year Rank]) && 'Date'[Day of Year] <- Max('Date'[Day of Year]) ))
LYTD ? CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]-max('Date'[Year Rank])-1 && 'Date'[Day of Year] <' Max('Date'[Day of Year])))

Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

Power BI — WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Calendario de fechas de creación -https://youtu.be/Qt0TM-4H09U

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únete a ella con la columna de fecha de tus hechos. recomienda:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Greg_Deckler
Super User
Super User

@dgarg_94- ¿Tiene algunos datos transaccionales de ejemplo que puede registrar como texto en una tabla? Sí, el tiempo "inteligencia" es casi inútil cuando tienes un calendario financiero personalizado.

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...

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.