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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bencefarsang
New Member

How can I change the variable for the 'value' property of a chart instead of drag and drop in MS Pow

I have the following 2 variables: Population and Density (Population / km2), and I'd like to visualize them using bar chart in Power BI. Instead of dragging and dropping variables manually into the value property of the chart, I'd like to accomplish this variable swap using some other user-friendly technique.

Should I introduce an action button (action on button click) or is there any more common way around?

Here is a demonstration of the problem:test.png

 

Thank you in advance!

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hi. There are some ways to do this. The most friendly might be bookmarks. Check this post using a toggle to change between matrixs. You can do it with this two bar charts. A bookmark to show or hide it:
https://blog.ladataweb.com.ar/post/186651845708/bookmarks-t1e1

If you don't like the toggle you can use button including a painted selected like this:

https://blog.ladataweb.com.ar/post/624889654552018944/powerbi-bookmarks-mejora-la-ux-para-botones

On the other hand you can create a table with the two options as rows (density and population). Then use in "values" a measure that asks:

IF ( SELECTEDVALUE ( Table[column], "Density") = "Density" , [Density], [Population])

 That way you can add the column from that small table as slicer to change between those values for the bar chart.

 

Hope one of those help


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

2 REPLIES 2
ibarrau
Super User
Super User

Hi. There are some ways to do this. The most friendly might be bookmarks. Check this post using a toggle to change between matrixs. You can do it with this two bar charts. A bookmark to show or hide it:
https://blog.ladataweb.com.ar/post/186651845708/bookmarks-t1e1

If you don't like the toggle you can use button including a painted selected like this:

https://blog.ladataweb.com.ar/post/624889654552018944/powerbi-bookmarks-mejora-la-ux-para-botones

On the other hand you can create a table with the two options as rows (density and population). Then use in "values" a measure that asks:

IF ( SELECTEDVALUE ( Table[column], "Density") = "Density" , [Density], [Population])

 That way you can add the column from that small table as slicer to change between those values for the bar chart.

 

Hope one of those help


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Thank you so much! 😁

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors