Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Resumir tabla - sustitución de espacios en blanco por 0 si no había entrada antes

Hola a todos

Necesito ayuda para resumir una tabla - ¿cómo escribo un código que reemplazaría los espacios en blanco con ceros, pero solo en los casos en que el elemento no ha tenido ninguna entrada antes de eso?

Esto es lo visual de mis datos.

Filas: identificadores de elemento, columnas representan MonthNo.

rigosakhx_2-1608775569907.png

EG si miramos los artículos 00 y 01, tenemos ventas en marzo y luego en blanco en mayo

Por otro lado, el punto 05 se introdujo en julio, así que quiero insertar ceros entre agosto y noviembre, pero no antes de julio.

La consulta actual es

RESUMIDA(Tabla A,[ItemId],[Fecha].[ MonthNo],"Sales",SUM(Transactions[QtyABS])

Estos datos se utilizan para calcular el uso medio mensual móvil mediante la función AVERAGEX. Mi problema es que la función promedio excluye 0s que resulta en un promedio más alto que real.

Espero que tenga sentido

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

No @rigosakhx ,

Consulte este tema y vea si es útil.

https://community.powerbi.com/t5/Desktop/Show-0-in-matrix-when-there-is-no-data-blank-Count-0-does-n...

Saludos

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
AllisonKennedy
Super User
Super User

@rigosakhx Puede definir variables que busquen el mes MIN para cada elemento, luego IF Month > MIN month, SUM() + 0, SUM()

Sin embargo, esto podría no ser exacto. ¿Cómo saber cuándo se introduce un artículo? ¿Tiene una tabla DimItem con fecha de lanzamiento o fecha introducida en algún lugar al que podamos acceder para este cálculo?


Please @mention me in your reply if you want a response.

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

Anonymous
Not applicable

Hola Allison

Hola

¿Podría compartir el enlace desde donde puedo descargar su archivo PBI.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.