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.
Este es mi problema:
Producto | Fecha de entrega cambiada en | Fecha de entrega antigua |
A | 2/1/20 | 5/15/20 |
A | 3/1/20 | 5/20/20 |
A | 4/1/20 | 5/16/20 |
La salida que estoy buscando es
Por lo tanto, Agrupar Min y luego Todas las filas no me dan la respuesta.
¿Alguna sugerencia? ¿Función tabla? ¿Función de lista?
Gracias por su ayuda
Solved! Go to Solution.
Hola @JMSNYC
puede usar Table.Group y usar un Table.SelectRows en él.
Aquí un ejemplo completo. Echa un vistazo al paso "Filas agrupadas" que hace el truco
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTLSN9Q3MgAyTPUNTUGsWB2IhDFCwsgAWcIESYcZWCIWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, #"Delivery Date Changed On" = _t, #"Old Delivery Date" = _t]),
DateFormat = Table.TransformColumns
(
Source,
{
{
"Delivery Date Changed On",
each Date.From(_,"en-US"),
type date
},
{
"Old Delivery Date",
each Date.From(_,"en-US"),
type date
}
}
),
#"Grouped Rows" = Table.Group(DateFormat, {"Product"}, {{"Min Date", each Table.SelectRows(_, (sel)=> sel[Delivery Date Changed On]= List.Min(_[Delivery Date Changed On])), type table [Product=text, Delivery Date Changed On=date, Old Delivery Date=date]}}),
#"Expanded Min Date" = Table.ExpandTableColumn(#"Grouped Rows", "Min Date", {"Delivery Date Changed On", "Old Delivery Date"}, {"Delivery Date Changed On", "Old Delivery Date"})
in
#"Expanded Min Date"
Copie pegue este código en el editor avanzado en una nueva consulta en blanco para ver cómo funciona la solución.
Si este post ayuda o resuelve su problema, márquelo como solución (para ayudar a otros usuarios a encontrar contenido útil y para reconocer el trabajo de los usuarios que le ayudaron)
Los Kudoes también son agradables.
Que te diviertas
Jimmy
Hola @JMSNYC
puede usar Table.Group y usar un Table.SelectRows en él.
Aquí un ejemplo completo. Echa un vistazo al paso "Filas agrupadas" que hace el truco
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTLSN9Q3MgAyTPUNTUGsWB2IhDFCwsgAWcIESYcZWCIWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, #"Delivery Date Changed On" = _t, #"Old Delivery Date" = _t]),
DateFormat = Table.TransformColumns
(
Source,
{
{
"Delivery Date Changed On",
each Date.From(_,"en-US"),
type date
},
{
"Old Delivery Date",
each Date.From(_,"en-US"),
type date
}
}
),
#"Grouped Rows" = Table.Group(DateFormat, {"Product"}, {{"Min Date", each Table.SelectRows(_, (sel)=> sel[Delivery Date Changed On]= List.Min(_[Delivery Date Changed On])), type table [Product=text, Delivery Date Changed On=date, Old Delivery Date=date]}}),
#"Expanded Min Date" = Table.ExpandTableColumn(#"Grouped Rows", "Min Date", {"Delivery Date Changed On", "Old Delivery Date"}, {"Delivery Date Changed On", "Old Delivery Date"})
in
#"Expanded Min Date"
Copie pegue este código en el editor avanzado en una nueva consulta en blanco para ver cómo funciona la solución.
Si este post ayuda o resuelve su problema, márquelo como solución (para ayudar a otros usuarios a encontrar contenido útil y para reconocer el trabajo de los usuarios que le ayudaron)
Los Kudoes también son agradables.
Que te diviertas
Jimmy
Esto es increíble !! Funciona perfectamente. Muchas gracias y muchos elogios.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |