如何在 Power BI 中显示总销售额条形图或任何视觉对象 [英] How to show Total Sale value Bar chart or any visual in Power BI
本文介绍了如何在 Power BI 中显示总销售额条形图或任何视觉对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以帮助我在条形图视觉效果的一个栏中获得总销售额,如下图所示.
Can anybody please help me in getting Total Sale in one bar in Bar Chart visual as show below in picture.
我在数据集中计算总数只是为了展示示例.
I have calculated total in dataset only just to show the example.
推荐答案
与表格或矩阵视觉不同,要在条形图上获取总数,您必须手动创建一个新表格以用作轴和一种在总和部分之间切换的新措施.
Unlike with a table or matrix visual, to get a total on a bar chart you have to do it manually by creating a new table to use as your axis and a new measure to switch between the total and the parts.
参见 这个社区帖子 例如.
以下是创建新表用作轴的方法:
Here's how you can create a new table to use as your axis:
ChartAxis = UNION ( VALUES ( Sales[City] ), ROW ( "City", "All" ) )
您还需要一个新的度量来显示图表:
You'll also need a new measure to put on the chart:
SalesByCity =
VAR AxisCity = SELECTEDVALUE ( ChartAxis[City] )
RETURN
IF (
AxisCity = "All",
SUM ( Sales[Sales] ),
CALCULATE ( SUM ( Sales[Sales] ), Sales[City] = AxisCity )
)
这篇关于如何在 Power BI 中显示总销售额条形图或任何视觉对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文