Graph 是否有一种方法可以避免无法将度量添加为功率双散点图的恒定线?
所以我想使用另一个表中的计算值或参考值作为幂BI中的y常量线。我知道没有默认的方法,但我想知道是否有解决办法。我有这个: 我想要这个:Graph 是否有一种方法可以避免无法将度量添加为功率双散点图的恒定线?,graph,powerbi,constants,Graph,Powerbi,Constants,所以我想使用另一个表中的计算值或参考值作为幂BI中的y常量线。我知道没有默认的方法,但我想知道是否有解决办法。我有这个: 我想要这个: 关键是如何让它引用另一个表或计算列中的值作为常量行,因为添加度量值现在不是一项功能。谢谢您可以添加另一个图表(折线图和堆积柱形图),将度量值包含在折线值中。删除背景,更改为关闭X轴和Y轴。我建议使用R或Python visual 在这种情况下,请确保定义水平线的测量值以忽略X轴维度的过滤器上下文(使用所有选定的)。此表(选项卡): 这个度量:measure=
关键是如何让它引用另一个表或计算列中的值作为常量行,因为添加度量值现在不是一项功能。谢谢您可以添加另一个图表(折线图和堆积柱形图),将度量值包含在折线值中。删除背景,更改为关闭X轴和Y轴。我建议使用R或Python visual 在这种情况下,请确保定义水平线的测量值以忽略X轴维度的过滤器上下文(使用
所有选定的)。此表(选项卡):
这个度量:measure=CALCULATE(平均值(Tabell[X]);ALLSELECTED(Tabell))+1
可以使用以下Python脚本创建一个散点图,该散点图的常数线始终为X+1的平均值:
# dataset = pandas.DataFrame(X, Y, Z)
# dataset = dataset.drop_duplicates()
# Klistra in eller skriv in din skriptkod här:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
# zorder is to make the dots above the grid
ax.scatter(dataset.Y, dataset.X, s=dataset.Z*100, c='grey',zorder=10)
# this shows a constant line between (0,Measure) and (10,Measure)
ax.plot([0,10],[max(dataset.Measure), max(dataset.Measure)], c='r', linestyle='--')
# this is to set the limit of the axes so the horisontal line doesnt decide the chart size
ax.set_xlim([0,6])
# to set the ticks yourself
ax.set_yticks(range(0,6,1))
# display a thin grid
plt.grid(True, lw=.3)
plt.show()
结果:
是的,如果可能的话,我希望有一个替代方案。非常感谢。
# dataset = pandas.DataFrame(X, Y, Z)
# dataset = dataset.drop_duplicates()
# Klistra in eller skriv in din skriptkod här:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
# zorder is to make the dots above the grid
ax.scatter(dataset.Y, dataset.X, s=dataset.Z*100, c='grey',zorder=10)
# this shows a constant line between (0,Measure) and (10,Measure)
ax.plot([0,10],[max(dataset.Measure), max(dataset.Measure)], c='r', linestyle='--')
# this is to set the limit of the axes so the horisontal line doesnt decide the chart size
ax.set_xlim([0,6])
# to set the ticks yourself
ax.set_yticks(range(0,6,1))
# display a thin grid
plt.grid(True, lw=.3)
plt.show()