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

¿Cómo repetir los valores hasta que se reemplazan?

Hola

Me gustaría cargar un archivo de Excel con datos presupuestarios para un mes determinado (por ejemplo, enero de 2020 - $4,000) y hacer que los datos se repitan para todos los meses subsiguientes hasta que se reemplaza (por ejemplo, mayo de 2020 - $4,500). ¿Cuál es la mejor manera de hacer esto, aparte de repetirlo en Excel?

Creo que este es un problema simple, pero no puedo encontrar una respuesta después de un poco de búsqueda.

Muchas gracias

8 REPLIES 8
amitchandak
Super User
Super User

@srholmes, No muy claro

puede crear un calendario y poner la lógica basada en el mes y hacerlo

Objetivo: if(Eomonth('Date'[Date],0)<-Eomonth(TODAY(),-1) && Data[Date]- Eomonth('Date'[Date],0),4000,4500)

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

Gracias por las respuestas a todos.

Aquí hay una muestra de lo que estoy tratando de lograr:

Datos de demostración

Hay varias categorías y me gustaría crear un presupuesto mensual para cada categoría que se repite cada mes en función de los valores de entrada hasta que los cambie en algún punto de revisión posterior. Tendré muchas más categorías por lo que preferiría no tener que hacerlas todas manualmente.

También tengo la consulta de fecha configurada también y voy a vincular a ella.


Muchas gracias


Simon

Gracias por los datos de demostración. Aquí está el código M para ver una manera de lograr este. Este es un buen ejemplo de lo poderoso que es M. ¡Llenando mesas enteras!

Dejar
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tVA9D4IwEP0rTWcSKArqqolxMRqDE2Go0EiTekfaEuXf2w5EPlZc7vveu3t5TlnIwjhiOxrQ1dqZM4eKW9Sdi0/YGtF7spdKGZcdsIVSKpLxj59HsLXy09uIFsEYkDFnjxK4W+BqEu9Ra3xLeJKQ3ETDu5cA6wnuYETZalERhRyI7nsjNpbM6dJ48kCmOZgGtV+92FpoMqxc24eS5aj0w98M4eNoAXmSGeA/5Unn9y8qj/um+AI=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Category_ID = _t, Category_L0 = _t, Category_L1 = _t, Category_L2 = _t, Category_L3 = _t, Recurrence_Frequency = _t, Amount = _t]),
"Tipo cambiado" - Table.TransformColumnTypes(Source,"Fecha", escriba date, "Category_ID", Int64.Type, "Category_L0", escriba text, "Category_L1", escriba text, "Category_L2", escriba text, "Category_L3", escriba text, "Recurrence_Frequency", escriba text, "Amount", Int64.Type?),
PooledRows á Tabla.Grupo ('"Tipo de cambio",'Fecha"', 'AllRows'', cada _, tabla de tipos [Fecha/fecha, Category_ID'número, Category_L0'texto, Category_L1'texto, Category_L2'texto' Category_L3'texto, Recurrence_Frequency'texto'
Custom1 - List.Transform(-0..23', cada Date.AddMonths(#date(2019,1,1), _)),
"Convertido a la tabla" - Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
"Changed Type1" á Table.TransformColumnTypes('Converted to Table','Column1','' nombre date'),
"Columnas renombradas" - Table.RenameColumns(-"Changed Type1",'Column1", "Fecha"-),
"Consultas combinadas" - Table.NestedJoin('"Renamed Columns", ''Fecha"', GroupedRows', ''Fecha"', 'Changed Type1', JoinKind.LeftOuter),
"Expanded Changed Type1" á Table.ExpandTableColumn('"Consultas combinadas", "Changed Type1", ''AllRows'', ''AllRows'')''
"Relleno abajo" - Table.FillDown(-"Expanded Changed Type1","AllRows"-),
"AllRows expandidos" - Table.ExpandTableColumn('''''''''''''''''''''''''''''''''''''''''''''''''''"AllRows", "Category_ID", "Category_L0", "Category_L1", "Category_L2", "Category_L3", "Recurrence_Frequency", "Amount", "Category_ID", "Category_L0", "Category_L1", "Category_L2", "Category_L3", "Recurrence_Frequency", "Amount")
En
"AllRows expandidos"

Si esto funciona para usted, márquelo como solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@srholmes La solución proporcionada por @mahoneypat funcionará, pero la única preocupación es agregar el número de filas para cada categoría, y se hinchará el modelo, mientras que el mismo valor de destino se puede lograr mediante medidas (sin agregar filas adicionales). Si hay menos categorías, sí usar soluciones @mahoneypat, pero si hay demasiadas categorías, es posible que tenga que replantearse su enfoque.

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!



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.

Gracias por las respuestas @parry2k y @mahoneypat - he intentado la sugerencia y conseguido adaptarla a la hoja de Excel local que tengo y ha funcionado - ahora tengo una fila para cada categoría en cada mes. ¡Gracias!

Mi modelo crecerá con el tiempo, así que puedo terminar con muchas categorías por lo que sería útil saber cómo hacerlo como una medida. ¿Está sugiriendo que intentaría crear una expresión que iguale al número más reciente cargado para esa categoría, y definirlo como "Presupuesto de categoría para el mes" o algo así?

Gracias


Simon

@srholmes eso es exactamente, no hay necesidad de crear una fila para cada mes y similar que se puede lograr por medida.



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.

mahoneypat
Employee
Employee

Puede hacerlo en el editor de consultas comenzando con una lista de todas las fechas/meses posibles, convirtiendo en tabla y, a continuación, fusionando o expandiendo los datos/consulta que tiene y, a continuación, realizando un Rellenar. En su caso, enero-abril tendría los mismos valores y luego sería "reemplazado" en mayo con el nuevo número.

Si esto funciona para usted, márquelo como solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@srholmes se puede transformar fácilmente en Power Query, pero los pasos de consulta dependerán del aspecto de los datos. ¿Por qué no publicar datos de ejemplo en un formato de tabla, desde allí será fácil proporcionar para llenar los datos de destino que faltan en función de los datos sin procesar.



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.

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.