admin管理员组文章数量:1122846
I have data1
which looks as shown below:
My data2
looks as shown:
I want to create a stacked column chart for data1
.
I create two measures for Installed Capacity and SentOut Demand in Power BI as shown:
Installed Capacity = Calculate(sum(data1[Capacity]), filter(data1, data1[Technology]<>"Demand"))
SentOut Demand = Calculate(sum(data1[capacity]), filter(data1, data1[Technology] = "Demand"))
I merge the Order in data2
with data1
and extend data1
.
I plot stacked column and line chart with
x-axis: Year
Column y-axis: Installed capacity
Line y-axis: SentOut Demand
Column legend: Technology
In stacked column and line chart, I sort the Technology based on Data2.order. And get the following plot. It looks good. However, the order of stacked columns (bottom to top) is just opposite to the order of legends (top to bottom). What can I do to make them of the same order?
The *.pbix file is present here
I have data1
which looks as shown below:
My data2
looks as shown:
I want to create a stacked column chart for data1
.
I create two measures for Installed Capacity and SentOut Demand in Power BI as shown:
Installed Capacity = Calculate(sum(data1[Capacity]), filter(data1, data1[Technology]<>"Demand"))
SentOut Demand = Calculate(sum(data1[capacity]), filter(data1, data1[Technology] = "Demand"))
I merge the Order in data2
with data1
and extend data1
.
I plot stacked column and line chart with
x-axis: Year
Column y-axis: Installed capacity
Line y-axis: SentOut Demand
Column legend: Technology
In stacked column and line chart, I sort the Technology based on Data2.order. And get the following plot. It looks good. However, the order of stacked columns (bottom to top) is just opposite to the order of legends (top to bottom). What can I do to make them of the same order?
The *.pbix file is present here
Share Improve this question edited yesterday hbstha123 asked yesterday hbstha123hbstha123 1,60618 silver badges39 bronze badges 2- Can you share a .pbix so we don't have to type everything out – davidebacci Commented yesterday
- 1 I don't think it can be uploaded. So I shared a link. – hbstha123 Commented yesterday
1 Answer
Reset to default 1This is a limitation of the native visual unfortunately. If you want more control, you'd have to look at something like Deneb.
Edit
You can hide the default legend and then create a fake one using another native visual. It is a hack but will achieve what you want visually and will still cross filter appropriately.
本文标签: plotSorting the order of legend and stacked column in the same order in Power BIStack Overflow
版权声明:本文标题:plot - Sorting the order of legend and stacked column in the same order in Power BI - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282001a1926504.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论