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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Mostrar siempre los datos del último lunes

Hola amigos, tengo una columna de fecha en mi informe basada en la columna de fecha cuando el usuario selecciona cualquier fecha que desee mostrar la fecha del lunes pasado en mi informe. ¿Puede ayudarme en DAX? Por ejemplo, hoy es martes 23 de noviembre cuando el usuario selecciona el martes 23/11/2021 quiero obtener la fecha del lunes pasado (15/11/2021) igual que para todos. Cuando el usuario selecciona cualquier fecha en la mitad del día, quiero mostrar siempre el lunes pasado.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

HI @Narayana7481

para encontrar el último lunes pruebe esto:

Measure =
VAR _D =
    SELECTEDVALUE ( table[date] ) -- this will return the selected date
VAR _WN =
    WEEKDAY ( _D, 2 ) -- this will returns a number from 1 to 7 identifying the day of the week of a date
VAR _WDV = _WN - 1 -- find the variance between Monday and selected date in a week
VAR _MD = _D - _WDV -- find the Moday date in the selected date week
RETURN
    _MD - 7
-- last week Monday date

Si esta publicación ayuda,considere aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
Aprecia tus felicitaciones!!
LinkedIn:
www.linkedin.com/in/vahid-dm/

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

HI @Narayana7481

para encontrar el último lunes pruebe esto:

Measure =
VAR _D =
    SELECTEDVALUE ( table[date] ) -- this will return the selected date
VAR _WN =
    WEEKDAY ( _D, 2 ) -- this will returns a number from 1 to 7 identifying the day of the week of a date
VAR _WDV = _WN - 1 -- find the variance between Monday and selected date in a week
VAR _MD = _D - _WDV -- find the Moday date in the selected date week
RETURN
    _MD - 7
-- last week Monday date

Si esta publicación ayuda,considere aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
Aprecia tus felicitaciones!!
LinkedIn:
www.linkedin.com/in/vahid-dm/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.