How to show Total Sale value Bar chart or any visual in Power BI

偶尔善良 提交于 2021-02-11 13:46:42

问题


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.


回答1:


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.

See this community post for example.

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 )
    )


来源:https://stackoverflow.com/questions/61784994/how-to-show-total-sale-value-bar-chart-or-any-visual-in-power-bi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!