cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors