Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
I_NeedMorePower
Helper III
Helper III

Is It Possible To Change Card Text Color Based On What You Click On Pie Chart?

Hello power people!

 

For example, I have vendors on a pie chart, each vendor segment in the pie chart has a different color, and I have a card visual to display the name of the vendor when I click on and highlight the vendor on the pie chart.

What i'm trying to do is, I want to change the color of the text on the card visual to change based on what color the vendor has on the pie chart. So if there is a vendor A which has a blue color on the pie chart, what I want to happen is when I click on this Vendor A, the text color of Card visual will turn blue.

 

Is this possible?

 

Thanks! 

4 REPLIES 4
dm-p
Super User
Super User

At this time, visuals only know about the report theme colour palette, and not about each other's colours, so even with custom visuals, you're not going to be able to understand the colour of a selection in another visual, just the filter context in the current page (if you have selected a specific data point).

 

I think that this is an ideal use case for expression-based formatting, which is planned to go into public preview in April (although the release notes are indicative). In this future-state, I imagine that this would work by setting up a measure to handle colour assignment and then this measure (or the DAX behind it) can be used anywhere that you need it (colour assignment in the pie chart; background assignment in the card).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




edhans
Super User
Super User

Not with the default card that comes with Power BI. Card with States by OKViz allows you to change the card color. You'd have to look at it to see if it fits your needs.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hello edhans, 

I tried it and I don't think it helps with what I meant if i'm correct.

What i'm trying to achieve is to have the same colors that the power bi generates randomly each time we open the report to apply them on the text on the card visual. Is there some kind of DAX function that gets the colors the power bi assigns to values on the pie chart, bar charts and the other visuals?

Capture.PNG

For example, here is the pie chart I have, as you can see, these colors were assigned by power bi itself, what I want to do is if I clicked on and highlighted one of these colors, I want the text color on card visual to have the same color as the one I highlighted.

Is this possible?

 

Thanks for the help!

Not that I am aware of. You'd have to dig into the custom visuals in the Power BI visual store and see if anyone has written such a thing.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.