简体   繁体   English

堆叠条形图中的PowerBI自定义图例和列颜色

[英]PowerBI Custom Legend and Column Colours in Stacked bar chart

so I am trying to customise the colours for the legends. 所以我想为图例自定义颜色。 Basically what I am trying to do is to group the legends by colour. 基本上我想做的是按颜色对图例进行分组。 For example image we have refineries which are in different locations in the world. 例如,我们在世界各地都有精炼厂。 So for example if refineries 1, 2 & 3 are in Asia they should be coloured in green, and if refineries 4 & 5 are in Europe, then they should be coloured in blue. 因此,例如,如果炼油厂1、2和3在亚洲,则应将其涂成绿色,如果炼油厂4和5在欧洲,则应将其涂成蓝色。 An example of this is shown below (created by excel): 下面显示了一个示例(由excel创建):

在此处输入图片说明

Currently in PowerBI, this is my stacked chart: 当前在PowerBI中,这是我的堆积图:

在此处输入图片说明

So as you can see, the colours are dependent on the refineries, rather than on the locations (which are stored in a related Locations table). 如您所见,颜色取决于炼油厂,而不取决于位置(这些位置存储在相关的“位置”表中)。

Any idea of how this can be tackled in PowerBI please? 请问如何在PowerBI中解决此问题?

Much appreciated! 非常感激!

It would be very useful for BI developers if you could customize and format a little bit in Power BI using the built-in tools and expressions, something similar to SSRS, where you can set a color property based on the report data. 如果您可以使用内置工具和表达式(类似于SSRS,可以在其中基于报告数据设置颜色属性)在Power BI中自定义并格式化一点,这对于BI开发人员将非常有用。 Hope features like that be implemented soon. 希望像这样的功能将很快实现。

As far as I know you can use Data Colors Pane: 据我所知,您可以使用“数据颜色”窗格:

在此处输入图片说明

Very manual and I think it breaks when new legends are added. 非常手工,我认为添加新的图例会中断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM