Forum Discussion
Sum with calculate
Hola
Estoy usando medidas calculadas en power bi y obtenido la siguiente tabla:
| ZONA | OL | KM | CHR - KM*SCORE | 03 HR - KM*SCORE | EV - KM*SCORE | MP - KM*SCORE | 10 HR - SCORE*KM | DNA - SCORE*KM |
| BAMBAS | 44 | 9407.74 | 465714.5695 | 777208.0639 | 0 | 0 | 843557.844 | 0 |
| BAMBAS | 45 | 21235.75 | 812160.363 | 1102506.272 | 0 | 0 | 1922655.156 | 0 |
| SUR | 50 | 6027.97 | 0 | 437910.3065 | 0 | 602797 | 602797 | 554787.0496 |
| NORTE | 62 | 5371.02 | 0 | 398533.4222 | 0 | 537102 | 364729.0936 | 449098.5944 |
| BAMBAS | 68 | 1212.47 | 66948.56283 | 72247.79203 | 1257.3 | 121247 | 121247 | 105246.9268 |
| SUR | 68 | 15155.52 | 0 | 1061439.397 | 0 | 1515552 | 1515552 | 0 |
| SUR | 70 | 3796.23 | 11673.15467 | 329007.5308 | 379623 | 379623 | 379623 | 379623 |
| ANTAMINA | 116 | 19104.73 | 0 | 1910473 | 0 | 1910473 | 1910473 | 1686459.603 |
| LIMA | 116 | 8722.61 | 872261 | 0 | 872261 | 872261 | 824244.1688 | |
| NORTE | 116 | 8507.17 | 0 | 249841.3357 | 0 | 850717 | 735620.6097 | 698742.936 |
| TOROMOCHO | 116 | 383.71 | 38371 | 0 | 38371 | 38371 | 38371 | |
| BAMBAS | 117 | 13162.96 | 488478.4886 | 1082553.935 | 0 | 0 | 1299331.767 | 1004306.146 |
| SUR | 117 | 965.77 | 0 | 96577 | 0 | 96577 | 96577 | 0 |
| CENTRO | 120 | 3413.87 | 341387 | 341387 | 0 | 341387 | 334380.5693 | 277393.972 |
| NORTE | 120 | 47.46 | 0 | 4746 | 4746 | 4746 | 4746 | 0 |
| SUR | 120 | 1023.58 | 0 | 69326.12161 | 0 | 102358 | 102358 | 14368.616 |
| BAMBAS | 121 | 5013.16 | 139306.2213 | 251369.1268 | 201226.98 | 501316 | 501316 | 0 |
| CENTRO | 121 | 3443.05 | 0 | 252088.5106 | 0 | 344305 | 264944.1495 | 176323.7544 |
| LIMA | 121 | 1507.96 | 150796 | 0 | 150796 | 150796 | 150796 | |
| NACIONAL | 121 | 12423.43 | 1182049.21 | 1242343 | 1212502.36 | 1242343 | 1242343 | 1178336.614 |
| CENTRO | 122 | 8478.71 | 0 | 423999.487 | 0 | 847871 | 847871 | 647894.1164 |
| NORTE | 122 | 9 | 438.3 | 900 | 900 | 900 | 900 | 900 |
| BAMBAS | 124 | 1953.45 | 97272.84858 | 195345 | 0 | 195345 | 195345 | 0 |
| NACIONAL | 124 | 5424.71 | 75358.73802 | 394064.2089 | 0 | 542471 | 433841.5923 | 222510.2856 |
| SUR | 124 | 1253.48 | 24393.13126 | 79627.47751 | 0 | 125348 | 125348 | 53358.8156 |
| SUR | 135 | 19155.5 | 0 | 1579324.272 | 0 | 1915550 | 1619027.227 | 1507550.367 |
| BAMBAS | 145 | 1883.54 | 0 | 188354 | 0 | 188354 | 188354 | 132350.256 |
| NORTE | 163 | 3865.97 | 299115.9271 | 386597 | 386597 | 386597 | 386597 | 386597 |
QUIERO APLICAR AL SIGUIENTE LOGICA PARA OBTENER LA SIGUIENTE TABLA:
DESEMPEÑO EV= SUMA (EV - KM*SCORE) / SUMA (KM)
DESEMPEÑO CHR = SUMA (CHR - KM*SCORE) / SUMA (KM)
DESEMPEÑO MP = SUMA (MP - KM*SCORE) / SUMA (KM)
...
| INDIVIDUO | CHR - KM*SCORE | 03 HR - KM*SCORE | EV - KM*SCORE | MP - KM*SCORE | 10 HR - SCORE*KM | DNA - SCORE*KM |
| TODAS LAS ZONAS-OL | 27.84122032 | 71.05101574 | 12.01894141 | 75.92397647 | 93.98688725 | 57.64896534 |
Saludos.
Parece que queire construir una table con un record que contiene sumas para la tabla de ejemplo.
https://radacad.com/creating-a-table-in-power-bi-using-dax-table-constructor
este articulo descirbe como hacerlo in DAX. Tienia que escribir una medida para cada columna, pero las medidas pueden hacer qualquier calculacion .
Soy un personal Power Bi Trainer aprendo cada vez que respondo a una pregunta
The Golden Rules for Power BI
- Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
- Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
- Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
- Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result to check on your steps along the way.
1 Reply
- kentyler
Solution Sage
Parece que queire construir una table con un record que contiene sumas para la tabla de ejemplo.
https://radacad.com/creating-a-table-in-power-bi-using-dax-table-constructor
este articulo descirbe como hacerlo in DAX. Tienia que escribir una medida para cada columna, pero las medidas pueden hacer qualquier calculacion .
Soy un personal Power Bi Trainer aprendo cada vez que respondo a una pregunta
The Golden Rules for Power BI
- Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
- Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
- Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
- Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result to check on your steps along the way.