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

Matriz de jerarquía de fechas

Hola

Tengo una ecuación para la fecha:

Fechas ?
ADDCOLUMNS(
CALENDARIO( FECHA ( 2013, 1, 1), FECHA ( Año ( HOY () ), 12, 31 ) ),
"Año del mes", FORMAT ( [Fecha], "mmm-aaaa" ),
"MonthYearSort", Año ( [Fecha] ) * 100 + MES ( [Fecha] )
)
Tengo una jerarquía de fechas:

Date.PNG

Cuando arregle esto en Matrix viz. Puedo ver días hasta abril.

Date Matrix.PNG

Tengo datos hasta agosto. ¿Cómo puedo hacer que la tabla muestre los datos hasta agosto?

7 REPLIES 7
Fowmy
Super User
Super User

@ShriHanuman

Creo que está utilizando tanto el calendario del sistema (Hora de fecha automática) y su calendario. SI es así, utilice solo el calendario que ha creado. Allí puede agregar YEAR, Mes nombre y así sucesivamente, luego intente.

Si necesita un calendario completo, utilice esto:

Calendar = 
	ADDCOLUMNS(
		CALENDARAUTO() /*CALENDAR(date(startyear,1,1),date(endyear,12,31))*/
		,"Day Name",FORMAT([Date],"DDDD")
		,"Day of Week",(WEEKDAY([Date],1))
		,"Day of Month",DAY([Date]) 
		,"Week",DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week Name", "Week of " & DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week of Year", WEEKNUM([Date],1)
		,"Month", DATE(YEAR([Date]),MONTH([Date]),1)
		,"Month Name", FORMAT([Date],"MMMM")
		,"Month of Year", MONTH([Date])
		,"Month Year Name", FORMAT([Date],"MMM") & " " & YEAR([Date])
		,"Month Year Name Sort",(100*YEAR([Date])+MONTH([Date]))
		,"Quarter",DATE(YEAR([Date]),SWITCH(ROUNDUP(DIVIDE(MONTH([Date]),3,1),0),1,1,2,4,3,7,4,10),1)
		,"Quarter Name", "Q" & ROUNDUP(MONTH([Date])/3,0)
		,"Quarter Year Name", "Q" & ROUNDUP(MONTH([Date])/3,0) & " " & YEAR([Date])
		,"Year", DATE(YEAR([Date]),1,1)
		,"Year #",YEAR([Date])
	)

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy ,

Gracias por la respuesta. ¿Qué cambios debo realizar en el código anterior para iniciar el cálculo del año a partir de 2013?

@ShriHanuman

Lo puse de 2013 a 2020. Si lo necesitas, puedes cambiarlo a cualquier fecha.


Calendar = 
	ADDCOLUMNS(
		CALENDAR(date(2013,1,1),date(2020,12,31)),
		,"Day Name",FORMAT([Date],"DDDD")
		,"Day of Week",(WEEKDAY([Date],1))
		,"Day of Month",DAY([Date]) 
		,"Week",DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week Name", "Week of " & DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week of Year", WEEKNUM([Date],1)
		,"Month", DATE(YEAR([Date]),MONTH([Date]),1)
		,"Month Name", FORMAT([Date],"MMMM")
		,"Month of Year", MONTH([Date])
		,"Month Year Name", FORMAT([Date],"MMM") & " " & YEAR([Date])
		,"Month Year Name Sort",(100*YEAR([Date])+MONTH([Date]))
		,"Quarter",DATE(YEAR([Date]),SWITCH(ROUNDUP(DIVIDE(MONTH([Date]),3,1),0),1,1,2,4,3,7,4,10),1)
		,"Quarter Name", "Q" & ROUNDUP(MONTH([Date])/3,0)
		,"Quarter Year Name", "Q" & ROUNDUP(MONTH([Date])/3,0) & " " & YEAR([Date])
		,"Year", DATE(YEAR([Date]),1,1)
		,"Year #",YEAR([Date])
	)

________________________

¿He respondido a tu pregunta? Marque este post como una solución, esto ayudará a otros!.

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy ,

Gracias por su respuesta. Desafortunadamente, incluso después de deshabilitar la función de fecha automática y usar el código de calendario, no puedo obtener datos mensuales de enero a agosto bajo una vista. La vista deja de mostrar los datos después de May1st. ¿Qué debo hacer para desplazar los datos hasta agosto?

Date Hierarchy.PNG

@ShriHanuman

MATRIX admite 100 columnas. Desafortunadamente, no se puede mostrar más que eso supongo.
Proporcione una segmentación de fecha para que el usuario pueda desplazarse dentro de eso y cambiar a la selección de intervalo diferente o siguiente intervalo de fechas.

https://community.powerbi.com/t5/Desktop/Too-many-values-Not-showing-all-data-in-Matrix/td-p/412759

________________________

¿He respondido a tu pregunta? Marque este post como una solución, esto ayudará a otros!.

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Gracias por su respuesta. ¿Cómo puedo averiguar si estoy usando mi columna de fecha o una columna generada automáticamente?

Estoy usando las siguientes columnas:

Dates_Hierarchy.PNG

HOLA @ShriHanuman ,

Tendrás que desactivar tu calendario automático de fecha y hora

Vea este video por qué debe desactivar su calendario de fecha y hora automática.

https://www.youtube.com/watch?v=d4yAzhIQqNk

Enlace para crear su propio calendario.


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/

saludos
Harsh Nathani
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

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.