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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calcular la diferencia de medida entre la categoría frente al cambio total general a lo largo del tiempo (.pbix adjunto)

Tengo una medida que calcula el % de otras dos columnas (es Carga como % de ventas). Quiero calcular cómo esto ha cambiado con el tiempo y la diferencia de las categorías frente al total general de un período anterior. No tengo claro cómo hacerlo.

He adjuntado un conjunto de datos de ejemplo, así como una imagen a continuación de lo que estoy tratando de hacer.

Ejemplo

La categoría A es del 1,2% en 2020

El Gran Total en 2019 fue del 0,38%

La diferencia entre la Categoría A en 2020 frente al Total General es de 0.35% - 1.20% - -0.85%.

¿Cómo calculo esta diferencia?

Ejemplo de datos en PowerBI: https://1drv.ms/u/s!AvCirXUmRp-JhbY86LW-Vr-skR6XPw?e=AmqJYb

example change.png

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Por favor, pruebe esta expresión para obtener el resultado deseado.

NewMeasure =
VAR thisyear =
    MIN ( DateTable[Year] )
VAR freightpctsalesminus = [Freight % of Sales minus % Change Difference]
VAR PYtotal =
    CALCULATE (
        [Freight % of Sales],
        ALL ( 'Table'[Category] ),
        ALL ( DateTable ),
        VALUES ( DateTable[Quarter] ),
        DateTable[Year] = thisyear - 1
    )
RETURN
    PYtotal - freightpctsalesminus

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hola @jcueland ,

Consulte la siguiente medida:

Measure =
VAR lastyear =
    CALCULATE (
        [Freight % of Sales],
        ALL ( 'Table'[Category] ),
        SAMEPERIODLASTYEAR ( DateTable[Date] )
    )
RETURN
    lastyear - [Freight % of Sales minus % Change Difference]

Capture.PNG

Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Saludos

Dedmon Dai

mahoneypat
Employee
Employee

Por favor, pruebe esta expresión para obtener el resultado deseado.

NewMeasure =
VAR thisyear =
    MIN ( DateTable[Year] )
VAR freightpctsalesminus = [Freight % of Sales minus % Change Difference]
VAR PYtotal =
    CALCULATE (
        [Freight % of Sales],
        ALL ( 'Table'[Category] ),
        ALL ( DateTable ),
        VALUES ( DateTable[Quarter] ),
        DateTable[Year] = thisyear - 1
    )
RETURN
    PYtotal - freightpctsalesminus

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors