Forum Discussion
Single Legend for multiple visuals?
- Anonymous1 year ago
Hi Mk60 ,
Thanks again for following up! you are right .The Matrix visual doesn’t support cell-level conditional formatting, which is why that black dot still shows up.
The Table visual does allow individual cell formatting, which is why the color blends work better, especially with the dot or space trick. If you prefer an even cleaner look (without any dot at all), try using a space " " in a column[ColorBox = " "] and apply background color conditional formatting ,that gives you simple color boxes, much like a native legend. I totally get that the Table layout may not be your ideal setup, but this is currently the closest way to fully control the legend style in Power BI.
The output is looks like:If my response helped you to reslove the query,consider acepting it as solution.
Regards,
Pallavi.
Hi Mk60 ,
Thank you for the followup! I would be happy to assist you.
The reason the colors didn’t show up is that Power BI doesn’t automatically apply color values from a column . To get those colors to appear, you may need to use conditional formatting and set it to pull the color from your ColorCode column in your LegendData table.
Here is how you can do :
- In your table or matrix visual, click the dropdown next to the Portfolio Type field.
- Go to Conditional formatting ,choose either Font color or Background color.
- Then under “Format by”, select Field value, and choose your ColorCode column.
This will help you to give a closer visual match.
Hope this helps.If so, consider accepting it as solution.
Regards,
Pallavi.
Hi Pallavi,
Oh, so we do need conditional formatting, that was my question. Yes, in that case this should work. I also used conditional formatting using my trmporary approach using Card (new) as my visual. However, I do have additional fallowup here, if you don't mind and I am not sure if that's possible, when using your solution: Is there a way to somehow remove Values from the color codes, (i.e.#3498DB), so that we only have colors in the boxes?
I could not find that as an option under visual formatting? Just curious. Regardless, I can sure accept your sugestion as a solution for my original question. Much appreciate your time and consideration.
Marin
- Anonymous1 year agoNot applicable
Hi Mk60 ,
Thanks again for the follow-up!
If you just want the color to show without the text, this make it work like using a colored dot with conditional formatting.- Create a new calculated column using below:
LegendDot = UNICHAR(11044) - Plot a matrix visual and drag the LegendDot and Portfolio Type.
- Click the dropdown on LegendDot in the visual’s Values pane.
-
Choose Conditional formatting , choose Font color.
-
In the formatting dialog ,set Format by Field Value and choose ColorCode column as the source then click OK.
Please refer the screenshot for detailed undesranding.
If this resolved your query,consider accepting it as solution.
Thank you for your cooperation.Have a great day!- Mk601 year agoResolver I
Thank you so much for your time with this. I looked at your last suggestion, and it did work for sure, but we still have black dot in the color, which I would prefer to eliminate. The problem is that matrix visual apparently does not allow to apply conditional formatting to each individual cell, (unlike regular Table visual), but table visual is not my ideal solution that I was hoping to get to? Perhaps I am looking for impossible solution, not sure 🙂
When using Table visual, not matrix, and using your latest dot suggestion, and then cell conditional formatting for each individual dot to blend it within, that might be an option. However such legend will then become somewhat similar to a default legend? Like for the blue example here, dot is blended in with conditional format:
Any other toughts? Thank you very much!
- Anonymous1 year agoNot applicable
Hi Mk60 ,
Thanks again for following up! you are right .The Matrix visual doesn’t support cell-level conditional formatting, which is why that black dot still shows up.
The Table visual does allow individual cell formatting, which is why the color blends work better, especially with the dot or space trick. If you prefer an even cleaner look (without any dot at all), try using a space " " in a column[ColorBox = " "] and apply background color conditional formatting ,that gives you simple color boxes, much like a native legend. I totally get that the Table layout may not be your ideal setup, but this is currently the closest way to fully control the legend style in Power BI.
The output is looks like:If my response helped you to reslove the query,consider acepting it as solution.
Regards,
Pallavi.
- Create a new calculated column using below: