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
s_mansell
Helper I
Helper I

Plan de 6 meses del último viernes del mes actual y primer viernes del próximo mes

Hola a todos

Estoy buscando crear esta tabla con la Deadline 1 siendo el último viernes del mes y Deadline 2 siendo el primer viernes del mes siguiente basado en la fecha de hoy mirando 6 meses por delante:

Por lo tanto, la fecha de hoy 30/04/20:

MesFecha límite 1Fecha límite 2
Abril24/04/2001/05/20

Mayo

29/05/2005/06/20
Junio26/06/2003/07/20
Julio31/07/2007/08/20
Agosto28/08/2004/10/20

Creo que necesito 3 medidas, una por mes, otra para la fecha límite 1 y la fecha límite 2. Cualquier ayuda sería muy apreciada!

4 REPLIES 4
v-xicai
Community Support
Community Support

Hola @s_mansell ,

¿Tiene sentido? Si es así, marque la respuesta adecuada como una solución para ayudar a otros que tienen el problema similar y cerrar el caso. Si no, avísame y trataré de ayudarte más.

Saludos

Amy

camargos88
Community Champion
Community Champion

Hola @s_mansell ,

En primer lugar, cree una tabla con Power Query con este código:

Dejar
Fuente: List.Dates(
Date.From(DateTime.FixedLocalNow()),
Duration.Days(Date.AddMonths(DateTime.FixedLocalNow(), 6) - DateTime.FixedLocalNow()),
#duration(1,0,0,0)
),
"Converted to Table" á Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
"Tipo modificado" ? Table.TransformColumnTypes("Converted to Table","Column1", fecha de tipo, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo de fecha, tipo
"Columnas renombradas" ? Table.RenameColumns("Changed Type","Column1", "Date" )
En
"Columnas renombradas"

Puede crear estas medidas:

D1 ?
VAR _date - SELECTEDVALUE(Query1[Date])
RETURN CALCULATE(MAX(Query1[Date]); FILTER(ALL(Query1); MES(Query1[Fecha]) - MES(_date) && YEAR(Query1[Date]) á YEAR(_date) && WEEKDAY(Query1[Date]; 1) á 6))
D2 - D2
VAR _date - SELECTEDVALUE(Query1[Date])
RETURN CALCULATE(MIN(Query1[Date]); FILTER(ALL(Query1); MES(Query1[Fecha]) - MES(_date) && YEAR(Query1[Date]) á YEAR(_date) && WEEKDAY(Query1[Date]; 1) á 6))
¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Greg_Deckler
Super User
Super User

Para Deadline1, estoy pensando algo como a continuación. Deadline2 sería un cálculo muy similar.

Deadline1 = 
  VAR __Month = MAX('Months'[MonthNum])
  VAR __Calendar = 
    ADDCOLUMNS(
      CALENDAR(YEAR(TODAY(),1,1),YEAR(TODAY(),12,31)),
      "__Weekday",WEEKDAY([Date])
      "__WeekNum",WEEKNUM([Date])
  VAR __MaxWeekNum = MAXX(FILTER(__Calendar,MONTH([Date]) = __Month),[__WeekNum])
  VAR __LastFriday = MAXX(FILTER(__Calendar,[__Weekday] = 6 && [__WeekNum] = __MaxWeekNum),[Date])
  VAR __FinalLastFriday = IF(ISBLANK(__LastFriday),MAXX(FILTER(__Calendar,[__Weekday] = 6 && [__WeekNum] = __MaxWeekNum - 1),[Date]),__LastFriday)
RETURN
  __FinalLastFriday


@ 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...
Greg_Deckler
Super User
Super User

Bueno, usted debe tener una tabla para Mes con el nombre del mes y el número de mes. A continuación, puede crear una medida que usaría como filtro para los meses que se mostrarán. Así, por ejemplo:

Filtro de medición ?

VAR __Month - MES(HOY())

VAR __MonthNum á MAX('Meses'[MonthNum])

devolución

IF(__MonthNum > __Month && __MonthNum <- __Month + 5),1,0)


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