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 a todos
Tengo una tabla de cotizaciones de D365 CRM. Durante la negociación, las cotizaciones se revisan para reflejar el valor de la transacción. Necesito crear una tabla con quoteID único y la cotización más reciente para la que puedo usar RevisionID.
Mi pensamiento es usar la función Table.SelectRows, pero no parece poder definir MAX como una condición.
E.g.
QuoteID | Nombre de la cita | RevisionID | Cantidad |
1 | Cita 1 | 0 | 25000 libras esterlinas |
1 | Cita 1 | 1 | 30000 libras esterlinas |
1 | Cita 1 | 2 | 27500 libras esterlinas |
2 | Cita 2 | 0 | 1500 libras esterlinas |
2 | Cita 2 | 1 | 2750 libras esterlinas |
Resultados
QuoteID | Nombre de la cita | RevisionID | Cantidad |
1 | Cita 1 | 2 | 27500 libras esterlinas |
2 | Cita 2 | 1 | 2750 libras esterlinas |
¿Alguna idea?
Gracias
Solved! Go to Solution.
Hola @aTChris
Coloque el siguiente código M en una consulta en blanco para ver los pasos.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQoszS9JVQCxDID40GIjUwMDA6VYHXRZw0MLwPLGBnB5sAhChRFEv7kpVN4ILmsEN90Qu6QhXKtSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [QuoteID = _t, #"Quote Name" = _t, RevisionID = _t, Amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"QuoteID", Int64.Type}, {"Quote Name", type text}, {"RevisionID", Int64.Type}, {"Amount", Currency.Type}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"QuoteID", Order.Ascending}, {"RevisionID", Order.Ascending}}),
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"QuoteID", "Quote Name"}, {{"Count", each List.Last([Amount]), Currency.Type}})
in
#"Grouped Rows"
Por favor, marque la pregunta resuelta cuando haya terminado y considere dar un pulgar hacia arriba si las publicaciones son útiles.
Póngase en contacto conmigo de forma privada para obtener asistencia con cualquier necesidad de BI a gran escala, tutoría, etc.
Salud
Gracias por eso. Creo que funcionará. Tengo muchos otros atributos en la tabla que necesito conservar. Debería poder aplicarlos en la agrupación.
Hola @aTChris
Coloque el siguiente código M en una consulta en blanco para ver los pasos.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQoszS9JVQCxDID40GIjUwMDA6VYHXRZw0MLwPLGBnB5sAhChRFEv7kpVN4ILmsEN90Qu6QhXKtSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [QuoteID = _t, #"Quote Name" = _t, RevisionID = _t, Amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"QuoteID", Int64.Type}, {"Quote Name", type text}, {"RevisionID", Int64.Type}, {"Amount", Currency.Type}}),
#"Sorted Rows" = Table.Sort(#"Changed Type",{{"QuoteID", Order.Ascending}, {"RevisionID", Order.Ascending}}),
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"QuoteID", "Quote Name"}, {{"Count", each List.Last([Amount]), Currency.Type}})
in
#"Grouped Rows"
Por favor, marque la pregunta resuelta cuando haya terminado y considere dar un pulgar hacia arriba si las publicaciones son útiles.
Póngase en contacto conmigo de forma privada para obtener asistencia con cualquier necesidad de BI a gran escala, tutoría, etc.
Salud
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 |