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
Fidzi8
Helper IV
Helper IV

Diferencia porcentual - celdas vacías

Hola
Necesitaría consejo.

procenta.png
Cómo solucionar para obtener -3.27%? No quiero contar celdas vacías.

Gracias
Ondřej

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

No @Fidzi8,

Cree una medida como se muestra a continuación:

_Measure = 
var _diff=DIVIDE(CALCULATE(SUM('Table (2)'[Cost/tn 21])-SUM('Table (2)'[Cost/tn 20]),FILTER('Table (2)','Table (2)'[Category]=MAX('Table (2)'[Category]))),SUM('Table (2)'[Cost/tn 20]))
var _totalfor21=CALCULATE(SUM('Table (2)'[Cost/tn 21]),NOT(ISBLANK('Table (2)'[Cost/tn 20])),ALL('Table (2)'))
var _totalfor20=CALCULATE(SUM('Table (2)'[Cost/tn 20]),NOT(ISBLANK('Table (2)'[Cost/tn 21])),ALL('Table (2)'))
Return
IF(ISINSCOPE('Table (2)'[Category]),_diff,DIVIDE(_totalfor21-_totalfor20,_totalfor20))

Y verás:

v-kelly-msft_0-1610339782398.png

Para el archivo .pbix relacionado, pls ver adjunto.

Saludos
Kelly

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

No @Fidzi8,

Cree una medida como se muestra a continuación:

_Measure = 
var _diff=DIVIDE(CALCULATE(SUM('Table (2)'[Cost/tn 21])-SUM('Table (2)'[Cost/tn 20]),FILTER('Table (2)','Table (2)'[Category]=MAX('Table (2)'[Category]))),SUM('Table (2)'[Cost/tn 20]))
var _totalfor21=CALCULATE(SUM('Table (2)'[Cost/tn 21]),NOT(ISBLANK('Table (2)'[Cost/tn 20])),ALL('Table (2)'))
var _totalfor20=CALCULATE(SUM('Table (2)'[Cost/tn 20]),NOT(ISBLANK('Table (2)'[Cost/tn 21])),ALL('Table (2)'))
Return
IF(ISINSCOPE('Table (2)'[Category]),_diff,DIVIDE(_totalfor21-_totalfor20,_totalfor20))

Y verás:

v-kelly-msft_0-1610339782398.png

Para el archivo .pbix relacionado, pls ver adjunto.

Saludos
Kelly

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

amitchandak
Super User
Super User

@Fidzi8, dependen de la fórmula, Comparte la fórmula y cuáles son las columnas de grupo

Consulte: https://www.youtube.com/watch?v=ufHOOLdi_jk

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.