Forum Discussion
Multiselect with Disconnect Table
- Anonymous1 year ago
Hi yashwant101
Please try the following measure:Measure = IF(ISFILTERED('Patient Copay Amount'[Patient Copay]), SWITCH( TRUE(), "0-50" IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]<=30, 1, "50-100"IN VALUES('Patient Copay Amount'[Patient Copay])&& [Total Copay]>30 && [Total Copay]<=100, 1, "100-150"IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]>100 && [Total Copay]<=160, 1, "150-200"IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]>160, 1, 0 ),1 )
Result:Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi yashwant101
To handle multiple selections, you can use the "IN" function along with "VALUES" to check if the Total Copay falls within any of the selected ranges. Here’s an updated version of your measure:
Measure =
IF(
ISFILTERED('Patient Copay Amount'[Patient Copay]),
SWITCH(
TRUE(),
MAX(Copay Table[Total Copay]) <= 3000 && "$0-$3000" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
MAX(Copay Table[Total Copay]) > 3000 && MAX(Copay Table[Total Copay]) <= 5000 && "$3000-$5000" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
MAX(Copay Table[Total Copay]) > 5000 && MAX(Copay Table[Total Copay]) <= 7500 && "$5000-$7500" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
MAX(Copay Table[Total Copay]) > 7500 && MAX(Copay Table[Total Copay]) <= 10000 && "$7500-$10000" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
MAX(Copay Table[Total Copay]) > 10000 && MAX(Copay Table[Total Copay]) <= 12500 && "$10000-$12500" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
MAX(Copay Table[Total Copay]) > 12500 && "Above $12500" IN VALUES('Patient Copay Amount'[Patient Copay]), 1,
0
),
1
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- yashwant1011 year agoHelper III
Hi Anonymous
Thanks for your response. If I use this formula when the first condition becomes correct, the rest are not executed. But since it is multiselect I want all teh statements to be executed. I have placed the file here
I have explained the requirement in the other response. Please have a look and let me know a way to achieve this.
Regards,
Yashwant
- Anonymous1 year agoNot applicable
Hi yashwant101
Please try the following measure:Measure = IF(ISFILTERED('Patient Copay Amount'[Patient Copay]), SWITCH( TRUE(), "0-50" IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]<=30, 1, "50-100"IN VALUES('Patient Copay Amount'[Patient Copay])&& [Total Copay]>30 && [Total Copay]<=100, 1, "100-150"IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]>100 && [Total Copay]<=160, 1, "150-200"IN VALUES('Patient Copay Amount'[Patient Copay]) && [Total Copay]>160, 1, 0 ),1 )
Result:Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.