Forum Discussion
Measure using SWITCH breaking my graph
Hi,
Iam trying to use a dynamic value in a grapth. Value is equal to the following measure :
MdxScript(Model) (14, 46) Calculation error in measure 'ReadmissionPeriods'[Selected]: A table of multiple values was supplied where a single value was expected.
Why is this happening? Can someone help please?
Thanks
Ilky
Anonymous , You can not have more than one value in such case
Try like
Selected = SWITCH(selectedvalue(ReadmissionPeriods[Readmission Types])," 2 Days",[% 2 Day Readmission], " 7 Days",[% 7 Day Readmission],"28 Days", [% 28 Day Readmission])
2 Replies
- amitchandakSuper User
Anonymous , You can not have more than one value in such case
Try like
Selected = SWITCH(selectedvalue(ReadmissionPeriods[Readmission Types])," 2 Days",[% 2 Day Readmission], " 7 Days",[% 7 Day Readmission],"28 Days", [% 28 Day Readmission])
- AnonymousNot applicable
Hi amitchandak
Thank you so much, it worked. You have been such great help 🙂
However, this is not the first time I am using switch in a measure and in a similar circumstances, it worked wit h the ALLSELECTED([columnname]). What makes it work sometimes and not work the others?
Regards
Ilky