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
powerbi2srm
Resolver II
Resolver II

SELECTEDVALUE with multiple selection

I've created a table in Power BI (Comparacion Ventas/Margen with two records in a column named "Medida": "Comparar con el margen" and "Comparar con las ventas":

Captura.JPG

I'm looking for when I select "Comparar con el margen" in a slicer, it shows me the calculated measure "margin" and when I select "Comparar con las ventas", it shows me the calculated measure "sales".

I get this result by creating two new measures:

margin (selection) =
IF( 
  SELECTEDVALUE('Comparacion Ventas/Margen'[Medida])= "Comparar con el margen",
  [margin], 
  BLANK() 
)

 

sales (selection) = 
IF( 
   SELECTEDVALUE('Comparacion ventas/margen'[Medida])= "Comparar con las ventas", 
   [sales], 
   BLANK() 
)



This works properly as long as I select only ONE option.

When I select the two options I get a blank result. You can check it in the following three photos:

Selecting marginSelecting marginSelecting salesSelecting salesCaptura4.JPG

 

Thank you so much!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Use a field parameter instead, they were specifically designed for this situation.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Use a field parameter instead, they were specifically designed for this situation.

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.