Forum Discussion
SelectedValue producing odd results
- 1 year ago
In your example, I can see only one Has Exception column so I dont know which is which -whether that is from dim_runner or dim_staff. What I would do though is to create measures that returns the SELECTEDVALUE of those columns - they might be returning blanks or values other than what are expected - and then add those measures to the viz
HasException_Runner = SELECTEDVALUE ( 'dim_runner'[Has Exception] ) HasException_Staff = SELECTEDVALUE ( 'dim_staff'[Has Exception] )Plese note that if SELECTEDVALUE sees more than one distinct value in the current row context, it will return blank.
Hi Mark_A12
By the looks of it, those measures should return either TRUE/FALSE but not an error so I am wondering what errors you're encountering. That aside, your measures could be simplified as:
HasException_Runner =
-- Returns TRUE if 'Has Exception' is not "No"
SELECTEDVALUE ( 'dim_runner'[Has Exception] ) <> "No"
HasException_Staff =
-- Returns TRUE if 'Has Exception' is "Yes"
SELECTEDVALUE ( 'dim_staff'[Has Exception] ) = "Yes"
Hi danextian, thank you for your advice, the error is they are incorrectly identifying if a runner has an exception. Text2 identifies Runner 2 as having an exception, whereas Text3 incorrectly identifies Runner 1 as not having an exception.
- danextian1 year ago
Super User
In your example, I can see only one Has Exception column so I dont know which is which -whether that is from dim_runner or dim_staff. What I would do though is to create measures that returns the SELECTEDVALUE of those columns - they might be returning blanks or values other than what are expected - and then add those measures to the viz
HasException_Runner = SELECTEDVALUE ( 'dim_runner'[Has Exception] ) HasException_Staff = SELECTEDVALUE ( 'dim_staff'[Has Exception] )Plese note that if SELECTEDVALUE sees more than one distinct value in the current row context, it will return blank.