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
ChrisCollao
Frequent Visitor

Tabla de calendario con meses "obsoletos"

Hola a todos,

Lo sentimos si el tema no se explica correctamente, pero, básicamente me gustaría preguntar si hay una manera de crear una tabla de calendario, donde puedo agregar una columna de mes, pero, con las condiciones que cada mes es de 26 a 25, en lugar de 1 a 30.

Explicar esto con un ejemplo: junio debe ser del 26 de mayo al 25 de junio. Y esto por cada mes.

MesIntervalo de fechas
Enerodec-26 a jan-25
Febrerojan-26 a feb-25
Marzofeb-26 a mar-25
......

Esto es para permitir que los usuarios filtre por mes, pero con los intervalos de fechas listos.

¿Tienes alguna idea?

Muchas gracias.

4 REPLIES 4
ChrisCollao
Frequent Visitor

Gracias a todos por las soluciones. Estaban bien. Pero acepté lo más simple y eficiente para mi caso.

Saludos a todos ustedes y gracias por el apoyo.

harshnathani
Community Champion
Community Champion

Hola @ChrisCollao ,

Asumo que tienes una tabla de citas

Crear una columna Calcular

New Month = IF (DAY(Dates[Date]) > 25, MONTH(Dates[Date]) + 1, Month(Dates[Date]))

Month Name = 
VAR n = Dates[New Month]
var _year = CONVERT(YEAR(Dates[Date]),STRING)
var _day = CONVERT(DAY(Dates[Date]),STRING)
RETURN  


    IF(
        n > 0 && n < 13 ,
        -- THEN --
        FORMAT(DATE(_year, n , _day ) , "MMM") ,
        -- ELSE --
        "Other"
        )


saludos

Harsh Nathani


Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

@ChrisCollao ya se proporcionan grandes soluciones, pero tomaré un enfoque diferente y usaré la función DAX menos conocida/utilizada

añadir una nueva columna en la tabla

Custom Month = 
VAR __newMonth = IF ( 
DAY ( 'Date'[Date] ) >= 26, EOMONTH ( 'Date'[Date], 1 ), 'Date'[Date] )
RETURN
FORMAT ( __newMonth, "MMM, YYYY" )

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Greg_Deckler
Super User
Super User

@ChrisCollao - Tal vez intente algo en la línea de esto:

Month = 
    VAR __Months = 
        {
            ("jan",1),("feb",2),("mar",3),("apr",4),("may",5),("jun",6),("jul",7),("aug",8),("sep",9),("oct",10),("nov",11),("dec",12)
        }
    VAR __Month = MONTH([Date])
    VAR __Day = DAY([Date])
    VAR __ReturnMonth = 
        SWITCH(TRUE(),
            __Day >=26 && __Month = 12,1,
            __Day >= 26,__Month+1,
            __Month
        )
RETURN
    MAXX(FILTER(__Months,[Value2]=__ReturnMonth),[Value1])

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