Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Does anybody know of a way to create a dynamic custom gradient bar legend that I could add to an Icon Map visual? I would like the ranges for each break in the legend to update whenever a slicer selection changes. Thank you for any advice!
Hi @aoberholzer
Creating a dynamic custom gradient bar legend in Power BI that updates with slicer selections is a multi-step process. Power BI doesn't have a native feature for a gradient bar legend, but you can simulate one using a stacked bar chart and some DAX measures to create dynamic binning based on slicer selections. Here's a general approach on how to do this:
Dynamic Measures: Create measures in DAX that will dynamically calculate the range for each bin based on the slicer selection. For example, if you're categorizing sales data, you would create measures that calculate the minimum and maximum sales and then divide the range into equal parts for your bins.
Stacked Bar Chart: Use a stacked bar chart to simulate the gradient bar. Each segment of the stack will represent a different range of your data. You will have to create a measure for each "bin" of the gradient that controls the size of each segment.
Conditional Formatting: Use conditional formatting to color each segment of the bar chart according to your desired gradient. You can set the color based on the value of the measure representing each bin.
Tool Tips: Customize the tooltips of the stacked bar chart to show the range of values that each color represents.
Synchronizing with Slicer: To ensure that the legend updates with the slicer, the measures that you use for binning and the ones that control the size of each segment in your stacked bar chart must be dependent on the slicer selection.
Icon Map Visual: To add this to an Icon Map visual, you will likely need to overlay the map and the gradient bar on the same report page. Make sure that both visuals interact with the same slicer(s).
Custom Visuals: If the default capabilities of Power BI aren't sufficient, you might look into custom visuals available in the marketplace that might meet your requirements more directly.
Bookmarks and Selection Pane: You can use bookmarks and the selection pane to show and hide certain visuals based on slicer selections, which can simulate a dynamic experience.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |