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.
Tengo una tabla con una jerarquía, por nivel de jerarquía hay un factor de suma que se aplica a toda la jerarquía subyacente.
Quiero calcular una columna con el coste total, que tiene en cuenta las cantidades de una fila y las filas subyacentes en la jerarquía.
A continuación un ejemplo de la tabla, incluida la columna con los valores calculados deseados (azul) y una representación visual de de calculation (rojo)
Gracias
Id | Parent_ID | Cantidad | Cantidad | Calcular | Cálculo visual |
1 | 1 | 100 euros | (2 * ((3 * (( 2 * 5 ) + ( 1 * 3 ))) + ( 1 * 4 ))) + (2 * 7) | ||
2 | 1 | 2 | 86 euros | 2 * ((3 * (( 2 * 5 ) + ( 1 * 3 ))) + ( 1 * 4 )) | |
3 | 1 | 2 | 7 euros | 14 euros | 2 * 7 |
4 | 2 | 1 | 4 euros | 4 euros | 1 * 4 |
5 | 2 | 3 | 39 euros | 3 * (( 2 * 5 ) + ( 1 * 3 )) | |
6 | 5 | 2 | 5 euros | 10 euros | 2 * 5 |
7 | 5 | 1 | 3 euros | 3 euros | 1 * 3 |
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 | |
2 | |
2 | |
2 | |
1 |