如何在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屋!
查看全文