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
PorterSmash
Regular Visitor

Choose a COLUMN to be used in a visual with a slicer

In short: I want to (effectively) choose the COLUMN within any given visual by using a slicer or parameter. [End]

My specific situation "in long": Let's say I have Map visual. For the location data field, I have a column that contains zip codes. I have another column in the table that tells whether that Zip code is closer to New York City, or if that Zip code is closer to Los Angeles. I have another column in the table that tells whether the Zip code is closer to New York City, or if it is closer to Dallas Texas. Like this:

Zip NYC or LA NYC or Dal
23158 NYC NYC
36821 LA DAL
18632 NYC DAL

 

I want the bubble representing the zip code to change color based on which city is closest. So I can put "NYC or LA" in the Legend spot on my visual, or I can put "NYC or Dal" in that spot. But I cannot put both. I want to be able to switch between the two using a slicer or parameter. So the Zip 18632 would change color after changing the slicer. [End]

I know you can do something SIMILAR to this using measures. Specifically, the SELECTEDVALUE() function. However, I need a row by row value. Context can be applied automatically when used in the correct visual, but I need a Map.

I attempted this tutorial. But despite the title, it just doesn't work for columns.

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...

 

I am open to any ideas. If it would work by using a single column "NYC or NEW" and the column could be re-evaluated based on a slicer, that would work. The data is completely open to modification.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PorterSmash 

 

Check if field parameters can help

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

 

Power BI- Create dynamic slicers using field parameters: https://youtu.be/H2ZxWaHAJZQ

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@PorterSmash 

 

Check if field parameters can help

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

 

Power BI- Create dynamic slicers using field parameters: https://youtu.be/H2ZxWaHAJZQ

This does exactly what I'm asking for. I looked at this exact thing and thought it didn't work. I have no idea how I missed it. Thank you for removing the wool from my eyes.

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.

Top Solution Authors