Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Tengo una tabla que quiero indexar dentro de un índice. Esta tabla contiene datos sobre productos y contiene múltiples intsances del "Número de tienda". Vea el ejemplo a continuación:
Sin embargo, quiero indexarlo dentro de un índice. Entonces, por ejemplo, hay tres ocurrencias del Store No, por lo que quiero que el resultado deseado sea como el siguiente.
|N.º de tienda|Producto|Índice|
|123 | Manzana | 1
|123 | Manzana | 2
|123 | Manzana | 3
|122 | Plátano | 1
Sí, cree una columna personalizada.
El código M que utilicé es
Table.AddColumn(#"Added Index", "CustomColumn", each
let
CurrentStoreNo = [Store No],
CurrentProduct = [Product],
CurrentIndex = [Index],
FilteredTable = Table.SelectRows(#"Added Index",
each [Store No] = CurrentStoreNo
and [Product] = CurrentProduct
and [Index] <= CurrentIndex),
CountRows = Table.RowCount(FilteredTable)
in
CountRows
)
Hola, gracias por la respuesta, pero ¿hay alguna manera de hacer esto en Power Query usando m? Quiero filtrar más los datos antes de que se carguen los datos.
Hola, gracias por la respuesta, pero ¿hay alguna manera de hacer esto en Power Query usando m? Quiero filtrar más los datos antes de que se carguen los datos.
Hi, @Rjn_93
al principio, cree una columna de índice en PQ a partir de 1. A continuación, ordene las filas en ascendente o desc y, a continuación, cierre y cargue los datos. Después de eso, cree una columna de cálculo.
Aquí está el archivo de la solución:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.