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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
horza
Frequent Visitor

using SELECTEDVALUE and SWITCH to choose multiple measures or columns

I'm fairly new to PowerBI. I've got to grips with using SELECTEDVALUE and SWITCH to accomplish a slicer that picks a measure to show in a single visualisation - in my case a clustered bar chart. I want the choice in the slicer to pick a set of measures to show in the clustered bar chart.

Imagine the slicer is selecting for an geographical area and in the bar chart I want to show a balance, incomings and outgoings for that area.


The code I have for the measure so far is below.. can I return some kind of collection??


WhichSalesArea =
var MySelection = SELECTEDVALUE('Measure Selection'[Measure Name], "Sales")
return SWITCH(TRUE(),
MySelection="Area1",[Area1],
MySelection="Area2",[Area2],
MySelection="Area3",[Area3],
MySelection
)

6 REPLIES 6
forgetmenot
Helper I
Helper I

@horza Did you find solution do this?

 

I'm having same issues Ic an use parameters in Bi to switch between 1 measure at time on chart, however i want to compare 2 measures at a time (so actuals Vs forecast) per category.

Does anyone know hot to achive this without having to create 4 charts/show hie with bookmarks?


amitchandak
Super User
Super User

Thanks for the links! The 'Guy in a cube' one is particularly interesting. However I can't apply that to the problem at hand.

The first two links are relevant but they only instruct on how to do the basic task of selecting one measure/column in the slicer. I can do that just fine. The problem is how to select multiple measures/columns.

To be more specific: Lets say I have a slicer where I can pick America, Asia and Europe. If I pick America I see a clustered chart where I can see three columns per time period e.g. balance, incomings, outgoings. I can pick Asia and see the balance, incomings and outgoings for each period in Asia... and Europe. The data for America, Asia and Europe is in 3 different tables. The balance, incomings and outgoings are in 3 different columns.

HotChilli
Community Champion
Community Champion

If the data for the 3 geographical areas is at the same granularity, why not make things easier by combining in one fact table?

Can you elaborate or provide an example?

Hi @horza ,

 

Can you  share some sample data in text format.

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.