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.
Hola.
Tengo un problema en la consulta de energía.
El primer colomn contiene información de pedido y el segundo colomns contiene Dates(first apperance is Date on stock and second is delivery to customer). ¿Cómo puedo completar las fechas entre estas dos fechas? He intentado fusionarme con una mesa de calender y rellenarla, pero no agrupa el relleno por órdenes, sólo hasta la próxima fecha.
Atentamente
Thomas
Hola, @Tand81
Según su descripción, creé datos para reproducir su escenario. El archivo pbix se adjunta al final.
Mesa:
Puede ir a 'Editor de consultas' e introducir los siguientes códigos en 'Advanced Editor'.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dc7BCQAhDETRXnJW1ESdWIvYfxvu6i6I6C3M40NqJQFQ1MKTIXXi2PN7BmpmR/xoP9WYNVhNz5Qdx61dFNcWQxnndqr4S6zjrVDO8VROa9w6", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ORdPos = _t, Date = _t, Cont = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ORdPos", type text}, {"Date", type date}, {"Cont", Int64.Type}}),
Custom2 = Table.AddColumn(#"Changed Type","RE",each
let x=[ORdPos],y=[Date]
in
Duration.Days( Table.Max(Table.SelectRows(#"Changed Type",each [ORdPos]=x),"Date")[Date]-y)
),
Custom3 = Table.AddColumn(Custom2,"list",each let x=[RE] in List.Generate(()=>1,each _<=x,each _+1)),
#"Expanded list" = Table.ExpandListColumn(Custom3, "list"),
Custom4 = Table.AddColumn(#"Expanded list","NewDate",each if
[list]<>null then [Date]+#duration([list]-1,0,0,0) else [Date]),
#"Removed Columns" = Table.RemoveColumns(Custom4,{"Date", "RE", "list"})
in
#"Removed Columns"
Resultado:
Saludos
Allan
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@Tand81 , consulte este archivo.
lógica necesita pocos cambios
https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0
@amitchandak Gracias.
Lo intenté, pero todavía no he logrado lo que estaba buscando.
No funcionó con este:
Funciona perfecto, gracias 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |