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
harib
Post Patron
Post Patron

Cómo obtener datos hasta el mes actual y los meses futuros con la columna condicional

Hola a todos

Me gustaría crear una segmentación de datos con los valores "Fecha futura", "Hasta fecha" para el campo de fecha.

Tengo una fecha presentada como abajo (MM/DD/AAAA)

Fecha

01/31/2020

02/29/2020

03/31/2020

04/30/2020

05/31/2020

06/30/2020

07/31/2020

Mi requisito es, si el usuario desea ver los datos de fecha futura puede seleccionar la opción "Fecha futura" de otra manera si el usuario desea ver los datos hasta el mes (05/31/2020) entonces puede seleccionar la opción "Hasta fecha" en la segmentación de datos.

Así que tengo crear fórmula como esta . Período futuro IF('Fecha'[Fecha]<-HOY(), "Fecha Futura","Hasta la Fecha")

Con la fórmula anterior soy capaz de obtener sólo datos hasta 04/30/2020, No está mostrando datos 05/31/2020. Me gustaría obtener este mes (05/31/2020) también.

Período futuro IF('Fecha'[Fecha]<-HOY()+31, "Fecha Futura","Hasta la Fecha")

Si agrego +31 entonces está mostrando datos a hasta el mes(05/31/2020), pero creo que esta no es la manera correcta.

¿Puede alguien por favor decirme cómo conseguirlo.

Gracias

8 REPLIES 8
v-easonf-msft
Community Support
Community Support

Hola , @harib

Si hoy es (05/11/2020), lo que desea es mostrar los datos a la última fecha de este mes(05/31/2020) , ¿verdad?

Si es así , se puede pensar en it(último día de este mes) como el primer día del mes siguiente menos un día .

Pruebe la columna calculada como se muestra a continuación:

Period Type 3 = 
var last_date_of_this_month=DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1
return
IF (Sheet2[Date-New] > last_date_of_this_month, "Future", "Till Date" )

pbix unido

Saludos
Equipo de Apoyo Comunitario _ Eason
Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

@v-easonf-msft

Excelente. Problema resuelto. 😊

Muchas gracias

parry2k
Super User
Super User

@harib poco confundido no es la fecha futura será nada después de hoy por lo que su fórmula sería

Period Type = IF ( 'Date'[Date] > TODAY(), "Future", "Till Date" )

si no funciona, comparta datos de muestra y qué resultados está obteniendo y qué está mal, explique el problema con los datos.



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.

@parry2k

He probado la fórmula que usted ha proporcionado, también está mostrando el resultado a 04/31/2020. No mostrar datos mensuales de mayo. Quiero mostrar hasta mayo mes.

@harib leyó mi respuesta anterior si esto no funciona, proporcione datos de muestra con detalles de lo que no funciona. No tengo manera de saber lo que está viendo y lo que no está funcionando y cómo está utilizando la información.



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.

@parry2k

He mencionado ejemplo de enlace PBIX. Por favor, donwload y hacer la necesidad ful.

Ejemplo de archivo PBIX : https://drive.google.com/file/d/1lwNNCQRV_nWMkfwdcrEeg89quWKsT98V/view?usp=sharing

Gracias

@harib no está disponible para descargar, necesita permiso.



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.

@parry2k

Lo siento.

Con permiso. Ahora puedes descargar el archivo .

Gracias

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.