cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.  Helper I

## selected value for multiple select

Hi All,

what I need is

if no region is selected in the region slicer then the measure need to show US region value for selected player

i.e for player A

if region is not selected then measure should show 100 (US region) if not then it should show max of selected regions

I can give if condition with selectedvalue() but it will not work when 2 items are selected

how can I overcome this?

Measure = SWITCH(
SELECTEDVALUE(Table1[player]),
"a",CALCULATE(MAX(Table1[value]),Table1[player]="a"),
"b",CALCULATE(MAX(Table1[value]),Table1[player]="b"),
"c",CALCULATE(MAX(Table1[value]),Table1[player]="c")
)

 player region value a india 300 a uk 200 a us 100 b india 400 b uk 190 b us 150 c india 900 c uk 170 c us 250
1 ACCEPTED SOLUTION  Impactful Individual

@newbie9 , Use this measure that will give result on the basis of whether region is selected or not.

Measure 4 = IF(ISFILTERED(Table1[region]) , SWITCH(
SELECTEDVALUE(Table1[player]),
"a",CALCULATE(MAX(Table1[value]),Table1[player]="a"),
"b",CALCULATE(MAX(Table1[value]),Table1[player]="b"),
"c",CALCULATE(MAX(Table1[value]),Table1[player]="c"))
, CALCULATE(MAX(Table1[value]), Table1[region] = "us") )
4 REPLIES 4  Impactful Individual

@newbie9 , Is this what the requirement is?    Helper I

yes that's it

when no region is selected for A then 100

if all regions are selected then 300

if us & uk is selected then 200

if uk & India is selected then 300

if uk alone then 200

if us alone then 100

no region is selected it should give show value of US region if not MAX of selected regions  Impactful Individual

@newbie9 , Use this measure that will give result on the basis of whether region is selected or not.

Measure 4 = IF(ISFILTERED(Table1[region]) , SWITCH(
SELECTEDVALUE(Table1[player]),
"a",CALCULATE(MAX(Table1[value]),Table1[player]="a"),
"b",CALCULATE(MAX(Table1[value]),Table1[player]="b"),
"c",CALCULATE(MAX(Table1[value]),Table1[player]="c"))
, CALCULATE(MAX(Table1[value]), Table1[region] = "us") )  Helper I

thanks @ChiragGarg2512

now it's working as expected Announcements #### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features. #### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings. Top Solution Authors
Top Kudoed Authors
Users online (6,332)