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.
Estoy buscando crear una medida CAGR de 5 años que no se vea afectada por la segmentación del año de fecha que filtra todos los demás datos de la tabla a un año específico. Ejemplo: 2016-2020 CAGR, pero todos los demás datos de la tabla deben mostrar solo los cálculos para 2020 basados en el filtro de segmentación de datos.
Fórmulas que estoy usando para calcular CAGR el primer año en el conjunto de datos es 2016 y el último año es 2020 - períodos de inicio y fin de CAGR:
Por favor, aconseje cómo no filtrar las fórmulas de valor inicial y final en función de la segmentación de un año en la tabla.
Gracias
Solved! Go to Solution.
Hola @DataNewbie
Construyo una nueva mesa para hacerme una prueba.
Industry_Revenue Tabla:
Luego construyo una nueva medida:
Cagr_Industry =
VAR _BeginningValue =
CALCULATE (
SUM ( 'Industry_Revenue'[Revenue] ),
FILTER (
ALL ( 'Industry_Revenue' ),
'Industry_Revenue'[year]
= MINX ( ALL ( 'Industry_Revenue' ), 'Industry_Revenue'[year] )
&& Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
)
)
VAR _EndingValue =
CALCULATE (
SUM ( 'Industry_Revenue'[Revenue] ),
FILTER (
ALL ( 'Industry_Revenue' ),
'Industry_Revenue'[year]
= MAXX ( ALL ( 'Industry_Revenue' ), 'Industry_Revenue'[year] )
&& Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
)
)
VAR _MinYear =
MINX (
FILTER (
ALL ( 'Industry_Revenue' ),
Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
),
'Industry_Revenue'[year]
)
VAR _MaxYear =
MAXX (
FILTER (
ALL ( 'Industry_Revenue' ),
Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
),
'Industry_Revenue'[year]
)
VAR _ofYears =
DATEDIFF ( _MinYear, _MaxYear, YEAR )
RETURN
IFERROR ( ( _EndingValue / _BeginningValue ) ^ ( 1 / ( _ofYears - 1 ) ), 0 )
Resultado:
Predeterminado:
Seleccione 2018 en Slicer:
Puede descargar el archivo pbix desde este enlace: Calcular CAGR de varios años mientras ignora el filtro de segmentación de datos para la fecha
Saludos
Rico Zhou
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @DataNewbie
¿Podría decirme si su problema ha sido resuelto? Si es así, acédi es la solución. Más gente se beneficiará de ello. O todavía está confundido al respecto, por favor proporcione más detalles sobre su problema o compártame con su archivo pbix de su Onedrive for Business.
Saludos
Rico Zhou
Hola @DataNewbie
Al igual que Ashish_Mathur respuesta, podemos usar todas las funciones para lograr su objetivo.
Construyo una tabla como se muestra a continuación para hacerme una prueba.
Cree una segmentación de datos, un objeto visual de tabla y un objeto visual de columna Cluster.
Luego caluculamos el cagr por medida.
Cagr =
VAR _BeginningValue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
FILTER (
ALL ( 'Table' ),
'Table'[year] = MINX ( ALL ( 'Table' ), 'Table'[year] )
)
)
VAR _EndingValue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
FILTER (
ALL ( 'Table' ),
'Table'[year] = MAXX ( ALL ( 'Table' ), 'Table'[year] )
)
)
VAR _ofYears =
DATEDIFF (
MINX ( ALL ( 'Table' ), 'Table'[year] ),
MAXX ( ALL ( 'Table' ), 'Table'[year] ),
YEAR
)
RETURN
IFERROR ( ( _EndingValue / _BeginningValue ) ^ ( 1 / ( _ofYears - 1 ) ), 0 )
Resultado:
Seleccionar 2018
Nuestra medida ganada’t cambiar por la cortadora.
Puede descargar el archivo pbix desde este enlace: Calcular CAGR de varios años mientras ignora el filtro de segmentación de datos para la fecha
Saludos
Rico Zhou
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @RicoZhou - su solución funciona perfectamente en el nivel general! Sin embargo, cuando dejo caer la medida CAGR en una tabla, no se actualiza en función de los catregories en cada fila. Ejemplo: Tengo industrias en la primera columna, cada fila es una industria diferente. Me gustaría ajustar su fórmula para proporcionar el CAGR para cada industria en la fila de la tabla. ¿Puede proporcionar orientación?
Gracias
Hola @DataNewbie
Construyo una nueva mesa para hacerme una prueba.
Industry_Revenue Tabla:
Luego construyo una nueva medida:
Cagr_Industry =
VAR _BeginningValue =
CALCULATE (
SUM ( 'Industry_Revenue'[Revenue] ),
FILTER (
ALL ( 'Industry_Revenue' ),
'Industry_Revenue'[year]
= MINX ( ALL ( 'Industry_Revenue' ), 'Industry_Revenue'[year] )
&& Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
)
)
VAR _EndingValue =
CALCULATE (
SUM ( 'Industry_Revenue'[Revenue] ),
FILTER (
ALL ( 'Industry_Revenue' ),
'Industry_Revenue'[year]
= MAXX ( ALL ( 'Industry_Revenue' ), 'Industry_Revenue'[year] )
&& Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
)
)
VAR _MinYear =
MINX (
FILTER (
ALL ( 'Industry_Revenue' ),
Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
),
'Industry_Revenue'[year]
)
VAR _MaxYear =
MAXX (
FILTER (
ALL ( 'Industry_Revenue' ),
Industry_Revenue[Industry] = MAX ( Industry_Revenue[Industry] )
),
'Industry_Revenue'[year]
)
VAR _ofYears =
DATEDIFF ( _MinYear, _MaxYear, YEAR )
RETURN
IFERROR ( ( _EndingValue / _BeginningValue ) ^ ( 1 / ( _ofYears - 1 ) ), 0 )
Resultado:
Predeterminado:
Seleccione 2018 en Slicer:
Puede descargar el archivo pbix desde este enlace: Calcular CAGR de varios años mientras ignora el filtro de segmentación de datos para la fecha
Saludos
Rico Zhou
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola
¿Funciona?
CALCULATE(SUM(table[revenue]),FILTER(ALL(table),table[year]-MIN(table[year])))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |