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
Me gustaría contar el número de repeticiones en función de mis columnas Purchase Doc. en PoweBI
En Excel, utilizo la fórmula NB.SI
Puro. Doc. Itm | Fecha | Qty | Número |
601 | 13.02.2020 | 2 | 1 |
601 | 13.02.2020 | 2 | 2 |
601 | 26.09.2019 | 8 | 3 |
601 | 15.11.2019 | 8 | 4 |
601 | 25.10.2019 | 10 | 5 |
602 | 15.11.2019 | 10 | 1 |
602 | 28.11.2019 | 7 | 2 |
602 | 10.12.2019 | 7 | 3 |
602 | 23.12.2019 | 10 | 4 |
602 | 20.01.2020 | 10 | 5 |
603 | 21.02.2020 | 5 | 1 |
603 | 23.03.2020 | 10 | 2 |
603 | 14.04.2020 | 10 | 3 |
604 | 29.05.2020 | 10 | 1 |
604 | 26.06.2020 | 10 | 2 |
607 | 26.09.2019 | 3 | 1 |
607 | 22.04.2020 | 1 | 2 |
610 | 10.09.2019 | 2 | 1 |
610 | 25.10.2019 | 5 | 2 |
612 | 15.11.2019 | 5 | 1 |
613 | 28.11.2019 | 8 | 1 |
Mi objetivo es calcular aumatically las columnas "Número"
¿Tiene una idea de la función DAX que se va a utilizar?
Muchas gracias por su ayuda, Saludos,
Muchas gracias a todos, funciona 🙂
Que tengas un buen día
Saludos
Hola
Prueba este código M
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Pur. Doc. Itm", Int64.Type}, {"date", type date}, {"qty", Int64.Type}}),
Partition = Table.Group(#"Changed Type", {"Pur. Doc. Itm"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
#"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"date", "qty", "Index"}, {"date", "qty", "Index"})
in
#"Expanded Partition"
Espero que esto ayude.
Hola @LudivineLOU ,
Para obtener el mismo resultado esperado que la tabla, primero debe agregar una columna de índice manualmente en la consulta power:
A continuación, cree una columna calculada como esta:
Column =
CALCULATE (
COUNT ( 'Table'[Pur.Doc.Itm] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Pur.Doc.Itm] ),
'Table'[Index] <= EARLIER ( 'Table'[Index] )
)
)
Obtendrá el resultado esperado:
Adjunto mi archivo de muestra que espera ayudarle, por favor compruébelo y pruébelo: count.pbix
Best Looks,
Yingjie Li
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@LudivineLOU , A medida que se repiten las fechas, es posible que necesite una columna de índice. o usar rango con un desempate
countx(filter(Table, table[Pur. Doc.] Earlier(table[Pur. Doc.] ) && table[Itm date] <-earlier(table[Itm date])
&& table[index] <-earlier(table[index]) ),table[Pur. Doc.] )
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
@LudivineLOU - Necesitas a Cthulhu. https://community.powerbi.com/t5/Quick-Measures-Gallery/Cthulhu/m-p/509739#M211
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 |