Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dax requerido para devolver el 1er martes y el 3er martes de un mes determinado de una columna (fecha abierta)

Dax requerido para devolver el 1er martes y el 3er martes de un mes determinado de una columna (Fecha abierta) que contiene la fecha en el formato como 01.Jan.2020.

Además, tenía Split Month Name, Day, Day Name de la columna anterior a todas las columnas separadas, pero después de esto no podría devolver el 1er martes y el 3er martes de un mes en particular.

Por favor, ayúdeme.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Aquí está el tercer martes:

Tercer Martes ?
VAR __Table ?
ADDCOLUMNS(
FILTRO('Calendario',WEEKDAY([Fecha],1) á 3),
"Pedido",COUNTROWS(FILTER('Calendario',WEEKDAY([Fecha],1) á 3 && 'Calendario'[Fecha] <-EARLIER('Calendario'[Fecha])))
)
devolución
MAXX(FILTER(__Table,[Pedido]-3),[Fecha])


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

9 REPLIES 9
Greg_Deckler
Community Champion
Community Champion

Aquí está el tercer martes:

Tercer Martes ?
VAR __Table ?
ADDCOLUMNS(
FILTRO('Calendario',WEEKDAY([Fecha],1) á 3),
"Pedido",COUNTROWS(FILTER('Calendario',WEEKDAY([Fecha],1) á 3 && 'Calendario'[Fecha] <-EARLIER('Calendario'[Fecha])))
)
devolución
MAXX(FILTER(__Table,[Pedido]-3),[Fecha])


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

1o y tercer martes voy a crear como medida o nueva columna?

Creé medidas. Probablemente podría adaptarse para una columna si se deshizo de agregaciones alrededor de ciertas referencias de columna.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

El tercer martes no funciona como he comprobado con Medidas y he utilizado una segmentación como visualización:

3er Martes ?
VAR __Table ?
ADDCOLUMNS(FILTER('New FR 2020',WEEKDAY([Fecha de apertura].[ Fecha],1) n.o 3),
"Order",COUNTROWS(FILTER('New FR 2020',WEEKDAY([Fecha abierta].[ Fecha],1) 3 && 'Nuevo FR 2020'[Fecha de apertura]. [Fecha] <o EARLIER('New FR 2020'[Fecha de apertura].[ Fecha]))))
devolución
MAXX(FILTER(__Table,[Order]-3),[Fecha de apertura].[ Fecha])

@Sourav_86_Babai - Voy a tener que hacerme saber lo que está pasando con más detalle. Basé mis cálculos en tener una tabla de fechas. Consulte el archivo PBIX adjunto. ¿Es eso lo que está utilizando también o está utilizando alguna tabla que tiene agujeros de fecha en ella?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler

Hola

Gracias por su respuesta.
Supongo que algo se está perdiendo.

Según su archivo:

Fecha - Fecha de apertura

Calender - Nuevo FR 2020

Traté de hacer cambios, pero no está funcionando.

Capture.JPG

saludos.

Greg_Deckler
Community Champion
Community Champion

¿Quieres la fecha del 1er martes y el martes 3? Usted podría hacer esto:

Primer martes ?
MINX(FILTER('Calendar',WEEKDAY([Date],1) á 3),[Fecha])



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Gracias @Greg_Deckler, su fórmula de medida funciona bien. ¿Sabe si hay una manera de marcar una fecha como el primer martes del mes, dentro de la definición de la tabla Calendario? Es decir, ¿sin tener que crear una medida separada?

@sphillips22 - Así que como columna necesitarías algo como:

Columna del primer martes ?
MINX(

FILTRO (

'Calendario',

WEEKDAY([Fecha],1) á 3 &&

Año([Fecha])-Año(EARLIER([Fecha])) &&

MES([Fecha])-MES(EARLIER([Fecha]))

),

[Fecha]

)



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.