Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi everyone,
I need some help with a simple "top 20" chart that shows top 20 zip codes by spend. These zip codes all fall under four "channels". I would like for the chart to change colors based on which channel is selected as a filter. I unfortunetly cannot post my data but I can provide pictures of the graph if needed. Thanks in advance!
Solved! Go to Solution.
@Anonymous OK, I think I understand a little better. Perhaps try a measure like below. In theory you can then tie rules to each value and corresponding color. You could also potentially use the ISFILTERED function here. Really difficult to say without knowing exactly what is going on.
Measure Color Flag =
IF(
HASONEVALUE('Table',[channel]),
SWITCH([channel],
"display",1,
"audio",2,
"video",3,
"social",4,
0
), 0
)
@Greg_Deckler Thank you Greg! I was able to combine your recomendation with the isfiltered function to get this:
@Anonymous One last thing, you could make that a little cleaner using a SWITCH(TRUE(),...) statement. Just use your true/false parts of your IF statements. Glad it helped you get there!
@Anonymous Should be able to do this with some fancy conditional formatting but hard to tell you what that would be exactly without sample data. Here's a thought. Make up some zip codes. Make up some channels. Make up some values. Post it as text. It doesn't need to be your data, just any data that can reasoanbly recreate the situation. Use Plum, Apple, Grape for your channels for example.
@Greg_Deckler thank you for your response! My data looks a little like this
There are some other columns but for this situation I dont think they are relevant. Every row is the spend for a specific zip or "exchange" and the channel. There are 4 channels: display, audio, social, and video. I have a bar graph with spend on the y axis sorted from highest spend to lowest spend with those zips as the x axis. When I filter out to a specific channel I would like the color to change and match the rest of the dashboard (other graphs where channel is broken out by color as the legend). Any advice would help! I havent had much luck finding a similair situation online
@Anonymous OK, I think I understand a little better. Perhaps try a measure like below. In theory you can then tie rules to each value and corresponding color. You could also potentially use the ISFILTERED function here. Really difficult to say without knowing exactly what is going on.
Measure Color Flag =
IF(
HASONEVALUE('Table',[channel]),
SWITCH([channel],
"display",1,
"audio",2,
"video",3,
"social",4,
0
), 0
)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |