cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper II

## SELECTEDVALUE doesn't works when filtering more than one region

Hi guys,

I have 4 regions: NA, LA, APAC, EMEA.

I have this main measure:

if(SELECTEDVALUE(DIM_REGION[DIVISION_NAME]) = "NORTH AMERICA", measure1 , measure2) )

This main measure works great if I only filter one region. The problem comes when I filter NORTH AMERICA and Any other region (LA for example). When this happens the main measure only use measure2 to make the calculation, this is because of the SELECTEDVALUE (he only works when only one region is selected).

Do you guys know any other function I can use to be able to filter by NORTH AMERICA and LATIN AMERICA with the result = measure1 + measure2?

Thanks

3 REPLIES 3
Super User

Hi @tsynenkyy
The first clause should be testing if Regions 'HASONEVALUE', if so check if SELECTEDVALUE eq NA or LA otherwise return what you would like to display in that case.

Did it work ?  ‌‌ Mark it as a solution to help spreading knowledge

Helper II

What I need is:

Filter = NA:

measure1 = 100\$

Filter  = LA

measure2 = 200\$

Filter = ALL (LA and NA)

measure 1 + 2 = 300\$

Super User

Here is another way

`MyMeasure=SWITCH(TRUE(),SELECTEDVALUE(Mytable[Regions])="NA",[Measure1],SELECTEDVALUE(Mytable[Regions])="LA",[Measure2],[Measure1]+[Measure2])`

Replace MyTable with you table name

Did it work ?  ‌‌👍 A kudos would be appreciated 📢 Mark it as a solution to help spreading knowledge

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors