Forum Discussion
Multiple values in SELECTEDVALUE
- 8 years ago
Hi RemiAnthonise,
Here we can use IF and OR instead of ||
Workinghours per month both = IF ( OR( SELECTEDVALUE('Workers'[Name])= "Test Employee"; SELECTEDVALUE('Workers'[Name])= "Test Person"); CALCULATE(SUMX('Calendar';'Calendar'[Workdays 4 days]))* [Workinghours9], CALCULATE(SUMX('Calendar';'Calendar'[Workdays 5 days]))* [Workinghours8])There is an example in the attached pbix.
https://www.dropbox.com/s/eudlobbyoz279bz/Multiple%20values%20in%20SELECTEDVALUE.pbix?dl=0
Regards,
Frank
Hi RemiAnthonise,
Here we can use IF and OR instead of ||
Workinghours per month both =
IF (
OR(
SELECTEDVALUE('Workers'[Name])= "Test Employee";
SELECTEDVALUE('Workers'[Name])= "Test Person");
CALCULATE(SUMX('Calendar';'Calendar'[Workdays 4 days]))* [Workinghours9],
CALCULATE(SUMX('Calendar';'Calendar'[Workdays 5 days]))* [Workinghours8])There is an example in the attached pbix.
https://www.dropbox.com/s/eudlobbyoz279bz/Multiple%20values%20in%20SELECTEDVALUE.pbix?dl=0
Regards,
Frank
Create a new measure for selected value
Selected = SELECTEDVALUE
('Workers'[Name])
IF ( Selected = "Test Employee" || Selected = "Test Person";
CALCULATE ( SUMX ('Calendar'; 'Calendar'[Workdays 4 days] ) ) * [Workinghours9];
CALCULATE ( SUMX ('Calendar'; 'Calendar'[Workdays 5 days] ) ) * [Workinghours8]
)
the thing is you have to repeat the expression it has to compare.
A better approach is what v-frfei-msft has already told you.
- RemiAnthonise8 years ago
Helper V
kohlivinayak yes you're right, I've tried the way as v-frfei-msft told me and this did the trick.
Thanks for your time, guys.