Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hola a todos, he estado teniendo problemas con los gráficos de áreas y me gustaría saber si alguien sabe como resolver algo similar.
Básicamente tengo una tabla como la siguiente:
| Mes | Factura antes del producto | Factura después | Ahorro |
| enero 2024 | $12,000 | $7,000 | $5,000 |
| febrero 2024 | $12,500 | $8,500 | $4,000 |
| marzo 2024 | $11,000 | $6,500 | $4,500 |
Una vez con esto necesito realizar una gráfica como la siguiente:
Alguien sabe como realizarlo?
Solved! Go to Solution.
Hi @alfertab
For your question, power bi may not be able to achieve your goal in the visual it currently offers.
I found a similar visual, but it may not be what you want. You can refer to it:
Or you can consider a custom visualization.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hola, muchas gracias por el planteamiento. Logré realizar algo similar a lo que buscaba utilizando matplotlib de python, aquí dejo el código que utilicé por si a alguien le sirve:
# El código siguiente, que crea un dataframe y quita las filas duplicadas, siempre se ejecuta y actúa como un preámbulo del script:
# dataset = pandas.DataFrame(Facturación despues mes, Facturación antes mes, Mes-Año)
# dataset = dataset.drop_duplicates()
# Pegue o escriba aquí el código de script:
import matplotlib as mb
import matplotlib.pyplot as plt
import numpy as np
#Hacer bonito el gráfico
mb.rcParams['font.size'] =12
mb.rcParams['text.color'] ="#000000"
mb.rcParams['axes.labelcolor']="white"
mb.rcParams['xtick.color']="white"
mb.rcParams['ytick.color']="white"
#Definir Parámetros
Mes = dataset.loc[:,'Mes-Año'].tolist()
Facturacionantes= dataset.loc[:,'Facturación antes mes'].tolist()
Facturaciondespues = dataset.loc[:,'Facturación despues mes'].tolist()
#Cambiar color de la parte de afuera del fondo
plt.figure(facecolor="#000000")
#Cambiar color de fondo
ax=plt.axes()
ax.set_facecolor("#000000")
#Crear barras
plt.plot (Mes, Facturacionantes, color ="#FFFFFF",linewidth=3)
plt.plot (Mes, Facturaciondespues, color = "#B3B3B3",linewidth=3)
plt.fill_between(Mes,FacturacionLoad,FacturacionNet, color="#FBED1D", alpha=0.85)
#Nombrar ejes
plt.xlabel("Mes")
plt.ylabel("Facturación [MXN]")
#Poner leyendas
plt.legend(["Facturación antes", "Facturación despues", "Ahorro"])
plt.show()
Hola, muchas gracias por el planteamiento. Logré realizar algo similar a lo que buscaba utilizando matplotlib de python, aquí dejo el código que utilicé por si a alguien le sirve:
# El código siguiente, que crea un dataframe y quita las filas duplicadas, siempre se ejecuta y actúa como un preámbulo del script:
# dataset = pandas.DataFrame(Facturación despues mes, Facturación antes mes, Mes-Año)
# dataset = dataset.drop_duplicates()
# Pegue o escriba aquí el código de script:
import matplotlib as mb
import matplotlib.pyplot as plt
import numpy as np
#Hacer bonito el gráfico
mb.rcParams['font.size'] =12
mb.rcParams['text.color'] ="#000000"
mb.rcParams['axes.labelcolor']="white"
mb.rcParams['xtick.color']="white"
mb.rcParams['ytick.color']="white"
#Definir Parámetros
Mes = dataset.loc[:,'Mes-Año'].tolist()
Facturacionantes= dataset.loc[:,'Facturación antes mes'].tolist()
Facturaciondespues = dataset.loc[:,'Facturación despues mes'].tolist()
#Cambiar color de la parte de afuera del fondo
plt.figure(facecolor="#000000")
#Cambiar color de fondo
ax=plt.axes()
ax.set_facecolor("#000000")
#Crear barras
plt.plot (Mes, Facturacionantes, color ="#FFFFFF",linewidth=3)
plt.plot (Mes, Facturaciondespues, color = "#B3B3B3",linewidth=3)
plt.fill_between(Mes,FacturacionLoad,FacturacionNet, color="#FBED1D", alpha=0.85)
#Nombrar ejes
plt.xlabel("Mes")
plt.ylabel("Facturación [MXN]")
#Poner leyendas
plt.legend(["Facturación antes", "Facturación despues", "Ahorro"])
plt.show()
Hi @alfertab
For your question, power bi may not be able to achieve your goal in the visual it currently offers.
I found a similar visual, but it may not be what you want. You can refer to it:
Or you can consider a custom visualization.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |