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
Syndicate_Admin
Administrator
Administrator

Cómo crear una medida para calcular promedios ponderados y desviaciones estándar a partir de datos no dinamizados

El enlace al archivo PBIX es: https://drive.google.com/file/d/1j_4CrUj0fPh0xK6hnO7OZ-uIWkoP5Kdg/view?usp=sharing

Estoy tratando de crear dos matrices, una con precio promedio ponderado y la otra con cambio porcentual promedio ponderado. También me gustaría medir la desviación estándar de Cambio porcentual para un año de modelo determinado de un vehículo.

Tengo datos en Excel que desesalgo en PowerQuery y, a continuación, extrago en BI. Los datos "antes de la no dinamización" que se desanciban constan de varias columnas de datos, que son esencialmente:

0% utilizado en el año de transacción actual

0% utilizado en el año de transacción anterior

% anualizado Variación del 0% utilizado

y luego se repite para cada uno de 20%, 40%, 50%, 60%, 80% y 100%. Los datos que permanecen pivotados incluyen [Unidades de año modelo] (es decir, número de unidades construidas en un año modelo).

Este es un ejemplo del aspecto de los datos antes de desesnear la dinamización:

Tipo de modeloUnidades de año modeloAño modeloAño de transacción0% utilizado en el año de transacción actual0% utilizado en el año de transacción anterior% anualizado Variación del 0% utilizado
A2020052010US$ 10.000
A2020052011US$ 9.000US$ 10.000-10.00%
A2020052012US$ 8.000US$ 9.000-11.11%
B1520052010US$ 5.000
B1520052011US$ 4.000US$ 5.000-20.00%
B1520052012US$ 3.000US$ 4.000-25.00%

Puedo obtener una matriz de valores promedio como se muestra a continuación, pero esto no pesa por [Unidades de año modelo], es simplemente el promedio de todas las instancias (Resumen promedio en una tabla dinámica).

mrothschild_0-1627842251159.png

Esta salida siguiente es de un archivo de Excel, pero es similar a la salida que me gustaría para una matriz de Power BI cuando se segmenta o no por modelo. Las columnas a la izquierda en la tabla siguiente son el promedio simple y las desviaciones estándar de las filas asociadas directamente a su derecha.

mrothschild_1-1627843159102.png

Estoy atascado en este punto y no sé cómo crear las medidas que necesito para generar la salida deseada.

¿Alguna ayuda, por favor? ¡gracias!

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

El formato para la programación de para encontrar el Promedio y StandardDeviation por filas ya se ha hecho.

Para promedio:

Row Average = 
// // In the "SUMMARIZE" section below, the first is the Table, second is the column from that table that represents the Matrix **COLUMNS**, and third is the column of data from that table that represents the Matrix **ROWS**.  
// After SUMMARIZE is closed, the next item is the MEASURE of the target criteria that one is looking to report the **average** of by Matrix rows. 

RETURN
    
        AVERAGEX (
            SUMMARIZE (
                'Helivalues Transaction History',
                'Helivalues Transaction History'[Sale Year],
                'Helivalues Transaction History'[Year of Build]
            ),
            [zzAverage Annualized Price change (weighted by Model Year Units)]
            ) 
        )

Para desviación estándar:

Row Average = 
// In the "SUMMARIZE" section below, the first is the Table, second is the column from that table that represents the Matrix **COLUMNS**, and third is the column of data from that table that represents the Matrix **ROWS**.  
// After SUMMARIZE is closed, the next item is the MEASURE of the target criteria that one is looking to report the **standard deviation** of by Matrix rows. 

RETURN
  
        STDEVX.S (
            SUMMARIZE (
                'Helivalues Transaction History',
                'Helivalues Transaction History'[Sale Year],
                'Helivalues Transaction History'[Year of Build]
            ),
            [zzAverage Annualized Price change (weighted by Model Year Units)]
            ) 
        )

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

El formato para la programación de para encontrar el Promedio y StandardDeviation por filas ya se ha hecho.

Para promedio:

Row Average = 
// // In the "SUMMARIZE" section below, the first is the Table, second is the column from that table that represents the Matrix **COLUMNS**, and third is the column of data from that table that represents the Matrix **ROWS**.  
// After SUMMARIZE is closed, the next item is the MEASURE of the target criteria that one is looking to report the **average** of by Matrix rows. 

RETURN
    
        AVERAGEX (
            SUMMARIZE (
                'Helivalues Transaction History',
                'Helivalues Transaction History'[Sale Year],
                'Helivalues Transaction History'[Year of Build]
            ),
            [zzAverage Annualized Price change (weighted by Model Year Units)]
            ) 
        )

Para desviación estándar:

Row Average = 
// In the "SUMMARIZE" section below, the first is the Table, second is the column from that table that represents the Matrix **COLUMNS**, and third is the column of data from that table that represents the Matrix **ROWS**.  
// After SUMMARIZE is closed, the next item is the MEASURE of the target criteria that one is looking to report the **standard deviation** of by Matrix rows. 

RETURN
  
        STDEVX.S (
            SUMMARIZE (
                'Helivalues Transaction History',
                'Helivalues Transaction History'[Sale Year],
                'Helivalues Transaction History'[Year of Build]
            ),
            [zzAverage Annualized Price change (weighted by Model Year Units)]
            ) 
        )

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.