cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtrevisiol
Helper III
Helper III

SELECTEDVALUE does not work

Hi everyone. 

I've got a calendar table with a hierarchy of dates and a slicer withe the years in the report. 

I created a measure that should return the selected year, using

 

selected year = SELECTEDVALUE(Calendar[Date].[Year], 123)
 
but I always get the alternative result (123), even if the year is selected. Do you know what the problem could be? Thank you.
3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @mtrevisiol 

 

Did you select multiple year values in the slicer? The SELECTEDVALUE only returns a single value. When multiple values are selected or none value is selected, it will return the alternative value. When you select a single year value, it works well.

 

I created a sample file, see if there is any difference from yours.

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Fowmy
Super User
Super User

@mtrevisiol 

Hope you have a Year column in the Calendar table?

Try this: 
selected year = SELECTEDVALUE(Calendar[Year], 123)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I've just tried, but still doesn't work...

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!