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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors