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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MatiasBI1986
Helper I
Helper I

-nan(ind) en la tabla, como dejarlos en 0?

Estimados, cómo están?

 

Tengo una tabla que funciona a partir de dos filtros cuyo DAX es:

 

N = SWITCH(TRUE(),
VALUES('KPI'[Métrica])="MAT",
SWITCH(TRUE(),
VALUES('Métrica'[Medida])="Unidades", FORMAT([Unidades MAT N],"#,##0"),
VALUES('Métrica'[Medida])="USD",FORMAT([Valor USD MAT N],"#,##0"),
VALUES('Métrica'[Medida])="Precio",FORMAT([Valor USD MAT N]/[Unidades MAT N],"#,##0")
),
VALUES('KPI'[Métrica])="Crecimiento",
SWITCH(TRUE(),
VALUES('Métrica'[Medida])="Unidades", FORMAT([Unidades MAT N]/[Unidades MAT N-1]-1,"0.00%"),
VALUES('Métrica'[Medida])="USD",FORMAT([Valor USD MAT N]/[Valor USD MAT N-1]-1,"0.00%"),
VALUES('Métrica'[Medida])="Precio",FORMAT([Precio USD N]/[Precio USD N-1]-1,"0.00%")))
 
DAX de algunos de los cálculos que basicamente se repite en los otros peridos N, N-2 y N-3:
 
Unidades MAT N-1 = CALCULATE(
    [Unidades],
    DATESINPERIOD(TOTAL[Fecha], MAX(TOTAL[Fecha]), -24, MONTH))-CALCULATE(
    [Unidades],
    DATESINPERIOD(TOTAL[Fecha], MAX(TOTAL[Fecha]), -12, MONTH))
 y 
 
Valor USD MAT N-1 = CALCULATE(
    [Valor USD],
    DATESINPERIOD(TOTAL[Fecha], MAX(TOTAL[Fecha]), -24, MONTH))-CALCULATE(
    [Valor USD],
    DATESINPERIOD(TOTAL[Fecha], MAX(TOTAL[Fecha]), -12, MONTH))
 
Sin embargo, a la hora de mostrar los valores, me aparecen los errores indicados en el asunto del tema.
 
MatiasBI1986_0-1689912828292.png

Cómo se podrían "eliminar" o cambiar por valores 0.

De antemano, muchas gracias.

 

Saludos!

 
4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

¿Puede garantizar que todos los valores en TOTAL[UNIDADES] sean resumibles? ¿Todos los números?

Sí, porque aparece el símbolo de sumatoria en la columna UNIDADES

 

MatiasBI1986_0-1690164151607.png

 

Eso quiere decir que todas los valores no tienen inconsistencia numérica, y pueden ser resumibles a través de operaciones matemáticas.

 

Saludos!

Syndicate_Admin
Administrator
Administrator

¿Cuál es la definición de [Unidades]?

Estimado,

 

La definición es:

 

Unidades = SUM(TOTAL[UNIDADES])
 
Saludos!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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