How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

huangapple go评论67阅读模式
英文:

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

问题

我有一个包含2023年和2050年五种产品(A、B、C、D和E)销售数据的数据集,它的形式是一个数据透视表,如下所示:

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

我想要制作一个组合图表,显示A、B、C和D作为柱状图,而E作为折线图。我选择年份作为横轴,产品作为图例,销售总额作为系列来创建数据透视图。

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

最初,图表如下所示:

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

但使用组合图表功能,我选择产品E作为折线图,得到所需的图表:

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

我试图在Power BI 中做类似的事情。

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

我还创建了一个新的度量 E_sales

E_sales = CALCULATE(SUM(sheet1[sales]), FILTER(sheet1, sheet1[Product] = "E"))

但我想从柱状图中移除E。当我从柱状图中过滤掉E时,E的折线图也被移除了。我该如何修复这个问题,以便只有A、B、C和D显示为柱状图,而E显示为折线图,就像在Excel中所示?

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

英文:

I have a dataset of sales values of five products: A, B, C, D and E in the form of pivot table for 2030 and 2050 which looks as follows:

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

I want to get combined chart showing A, B, C and D as columns. And E as line.
I select Year as axis, Product as legend and Sum of sales as series to get the pivot chart.

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

Initially, the chart looks as follows:
How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

But using the combined chart feature, I select product E as line chart and get the required chart:
How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

I am trying to do something similar in Power BI.
How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

I also created a new measure E_sales:

E_sales = Calculate(sum(sheet1[sales]), filter(sheet1, Sheet1[Product]="E"))

However, I want to remove E from the column chart. And when I filter out E from column chart, the line for E also get removed. How can I fix this such that I have only A, B, C and D as columns and E as line chart similar to what I have in Excel above?
How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

答案1

得分: 1

我通过创建一个新的度量来解决了这个问题,该度量排除了产品 E,并将其用于列数值,并且对于行数值使用了仅包括 E 值的度量。

ProductExceptE = calculate(sum(Sheet1[Sales]), filter(sheet1, Sheet1[Product]<>"E"))

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

英文:

I fixed it by creating a new measure that excluded product E and using it for column values, and using the measure that includes only E values for line values.

ProductExceptE = calculate(sum(Sheet1[Sales]), filter(sheet1, Sheet1[Product]<>"E"))

How to get filtered value of an item as line chart which is absent from column chart in combined chart in Power BI?

huangapple
  • 本文由 发表于 2023年2月13日 23:04:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75437640.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定