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.
Estimados ayudantes,
Espero que puedas ayudarme ya que estoy atrapado aquí.
Tengo algunos datos de ventas mensuales de los últimos años. Ahora me gustaría ver un promedio a largo plazo mensual en comparación con las ventas del mes actual. En Excel se vería como lo siguiente, basado en "minif", "maxif" y "averageif" teniendo en cuenta todos los datos antes de la Fecha de Venta:
Fin de mes | Monthnum | Ventas | Min mensual | Máximo mensual | Promedio mensual. |
31.01.2018 | 1 | 789 | |||
28.02.2018 | 2 | 1000 | |||
31.03.2018 | 3 | 250 | |||
30.04.2018 | 4 | 804 | |||
31.05.2018 | 5 | 433 | |||
30.06.2018 | 6 | 313 | |||
31.07.2018 | 7 | 261 | |||
31.08.2018 | 8 | 130 | |||
30.09.2018 | 9 | 264 | |||
31.10.2018 | 10 | 710 | |||
30.11.2018 | 11 | 324 | |||
31.12.2018 | 12 | 772 | |||
31.01.2019 | 1 | 213 | 789 | 789 | 789 |
28.02.2019 | 2 | 385 | 1000 | 1000 | 1000 |
31.03.2019 | 3 | 650 | 250 | 250 | 250 |
30.04.2019 | 4 | 257 | 804 | 804 | 804 |
31.05.2019 | 5 | 894 | 433 | 433 | 433 |
30.06.2019 | 6 | 629 | 313 | 313 | 313 |
31.07.2019 | 7 | 863 | 261 | 261 | 261 |
31.08.2019 | 8 | 574 | 130 | 130 | 130 |
30.09.2019 | 9 | 134 | 264 | 264 | 264 |
31.10.2019 | 10 | 406 | 710 | 710 | 710 |
30.11.2019 | 11 | 145 | 324 | 324 | 324 |
31.12.2019 | 12 | 699 | 772 | 772 | 772 |
31.01.2020 | 1 | 780 | 213 | 789 | 501 |
29.02.2020 | 2 | 523 | 385 | 1000 | 692,5 |
31.03.2020 | 3 | 666 | 250 | 650 | 450 |
30.04.2020 | 4 | 638 | 257 | 804 | 530,5 |
31.05.2020 | 5 | 555 | 433 | 894 | 663,5 |
30.06.2020 | 6 | 641 | 313 | 629 | 471 |
31.07.2020 | 7 | 97 | 261 | 863 | 562 |
31.08.2020 | 8 | 995 | 130 | 574 | 352 |
30.09.2020 | 9 | 569 | 134 | 264 | 199 |
31.10.2020 | 10 | 870 | 406 | 710 | 558 |
30.11.2020 | 11 | 516 | 145 | 324 | 234,5 |
31.12.2020 | 12 | 938 | 699 | 772 | 735,5 |
31.01.2021 | 1 | 474 | 213 | 789 | 594 |
28.02.2021 | 2 | 400 | 385 | 1000 | 636 |
31.03.2021 | 3 | 605 | 250 | 666 | 522 |
30.04.2021 | 4 | 646 | 257 | 804 | 566,3333333 |
31.05.2021 | 5 | 929 | 433 | 894 | 627,3333333 |
30.06.2021 | 6 | 612 | 313 | 641 | 527,6666667 |
31.07.2021 | 7 | 473 | 97 | 863 | 407 |
31.08.2021 | 8 | 78 | 130 | 995 | 566,3333333 |
30.09.2021 | 9 | 945 | 134 | 569 | 322,3333333 |
31.10.2021 | 10 | 13 | 406 | 870 | 662 |
30.11.2021 | 11 | 682 | 145 | 516 | 328,3333333 |
31.12.2021 | 12 | 647 | 699 | 938 | 803 |
31.01.2022 | 1 | 614 | 213 | 789 | 564 |
28.02.2022 | 2 | 1300 | 385 | 1000 | 577 |
31.03.2022 | 3 | 500 | 250 | 666 | 542,75 |
30.04.2022 | 4 | 600 | 257 | 804 | 586,25 |
31.05.2022 | 5 | 433 | 929 | 702,75 | |
30.06.2022 | 6 | 313 | 641 | 548,75 | |
31.07.2022 | 7 | 97 | 863 | 423,5 | |
31.08.2022 | 8 | 78 | 995 | 444,25 | |
30.09.2022 | 9 | 134 | 945 | 478 | |
31.10.2022 | 10 | 13 | 870 | 499,75 | |
30.11.2022 | 11 | 145 | 682 | 416,75 | |
31.12.2022 | 12 | 647 | 938 | 764 |
El objetivo es tener un Gráfico como el siguiente:
Apuesto a que esto es posible en power bi usando DAX. Sin embargo, simplemente no sé cómo.
Realmente espero sus sugerencias y ayuda.
BR
Manuel
Solved! Go to Solution.
Hay @Manuel123 ,
Si desea crear monthly min/max/avg. en Power BI, puede probar dax para crear columnas calculadas.
Monthly min =
CALCULATE (
MIN ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
Monthly max =
CALCULATE (
MAX ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
Monthly avg. =
CALCULATE (
AVERAGE ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
El resultado es el siguiente.
Saludos
Rico Zhou
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
Hay @Manuel123 ,
Si desea crear monthly min/max/avg. en Power BI, puede probar dax para crear columnas calculadas.
Monthly min =
CALCULATE (
MIN ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
Monthly max =
CALCULATE (
MAX ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
Monthly avg. =
CALCULATE (
AVERAGE ( 'Table'[Sales] ),
FILTER (
'Table',
'Table'[End of Month] < EARLIER ( 'Table'[End of Month] )
&& 'Table'[Monthnum] = EARLIER ( 'Table'[Monthnum] )
)
)
El resultado es el siguiente.
Saludos
Rico Zhou
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |