Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
When there is change in the data the colors of the legend in the date category changes automatically for bar chart or tree chart
is there a way to over ride data category color and keep it same as even the back end data changes :
Examaple : Bar Chart --We have bins like bin1 0 -5 days ,bin2 5 -10 ( We have one color for each bin )
Now when we change the bin to bin1 :0-10 bin 2 :10-15 the color of the previuous bins defined will go away is there a way to keep the color same even thought when we change the bins ...this is typical bussiness requirmet help is much appreciated
Thanks
Kalyana
Solved! Go to Solution.
Hi @bezawak ,
Please check if this could meet your requirements:
1. Create columns like so:
bin =
SWITCH (
TRUE (),
[days] >= 0
&& [days] <= 5, "0-5 days",
[days] > 5
&& [days] <= 10, "5-10 days",
[days] > 10
&& [days] <= 15, "10-15 days"
)
bin sort =
RANKX (
'Table',
CONVERT (
LEFT (
SUBSTITUTE ( [bin], " ", "-" ),
SEARCH ( "-", SUBSTITUTE ( [bin], " ", "-" ) ) - 1
),
INTEGER
),
,
ASC,
DENSE
)
2. Create a bin color measure.
bin color = SWITCH ( MAX ( 'Table'[bin sort] ), 1, "Red", 2, "Blue", 3, "Yellow" )
3. Set data colors.
4. Then you will get this:
BTW, .pbix file attached.
Best Regards,
Icey
Hi @bezawak ,
Please check if this could meet your requirements:
1. Create columns like so:
bin =
SWITCH (
TRUE (),
[days] >= 0
&& [days] <= 5, "0-5 days",
[days] > 5
&& [days] <= 10, "5-10 days",
[days] > 10
&& [days] <= 15, "10-15 days"
)
bin sort =
RANKX (
'Table',
CONVERT (
LEFT (
SUBSTITUTE ( [bin], " ", "-" ),
SEARCH ( "-", SUBSTITUTE ( [bin], " ", "-" ) ) - 1
),
INTEGER
),
,
ASC,
DENSE
)
2. Create a bin color measure.
bin color = SWITCH ( MAX ( 'Table'[bin sort] ), 1, "Red", 2, "Blue", 3, "Yellow" )
3. Set data colors.
4. Then you will get this:
BTW, .pbix file attached.
Best Regards,
Icey
@bezawak , Any visual using legend or details can not have conditional formatting and we can not control sequence of color. Please see there might be an idea on that. Vote for that or log a new one.
https://ideas.powerbi.com/forums/265200-power-bi-ideas
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Try re-applying your theme to the .pbix file after categories have changed. What I have seen is colors 1, 2 and 3 will be applied to categories 1, 2, and 3 (0-10, 11-20, 21-30) and when the categories change it applies the next colors to the new categories. Re-applying the them applies colors starting at 1 to the new categories.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |