cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Yuval_Marnin Frequent Visitor
Frequent Visitor

SELECTEDVALUE not working

Hi,

I trying to use SELECTEDVALUE function and it is not returning any value after I filter the reoprt when pressing one bar at Bar chart.

 

my syntex is very simple:

 

test = SELECTEDVALUE(Y2017[Country])

 

power bi.JPG

any ideas what am I doing wrong?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: SELECTEDVALUE not working

Hey,

 

the measure Measure looks like this:

Measure = SELECTEDVALUE(Y2017[Country])

Assigning the this measure to title of the text box like so:

image.png

Creates a report like this:

image.png

Unfortunately the title will of the chart itself will not be updated, not sure if this is a bug or by design. Maybe you want to create an issue.

 

Regards,

Tom

 

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
9 REPLIES 9
Super User
Super User

Re: SELECTEDVALUE not working

What are you trying to do?  I only see 1 visual



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Yuval_Marnin Frequent Visitor
Frequent Visitor

Re: SELECTEDVALUE not working

Fetching the selected value. In the example "Denemark"

Super User
Super User

Re: SELECTEDVALUE not working

Where are you expecting to see the selected value?  I only see one visual - the one you are selecting. Please explain exactly what you expect to see. 



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Super User
Super User

Re: SELECTEDVALUE not working

Hey,

 

I created a measure like you did to capture the selection of the axis value:

GetSelected Sales Territory = SELECTEDVALUE('Dimension City'[Sales Territory])

I assigned the measure to a card visual, as you can see from the gif below, it works as expected, so as @MattAllington asked, please describe in more detail your expected result.

chart axis and SELECTEDVALUE.gif

A card visual is above the column chart that is captures the selected sales territory, and goes blank if no axis value is selected.

 

Regards,

Tom

 

 

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Yuval_Marnin Frequent Visitor
Frequent Visitor

Re: SELECTEDVALUE not working

@TomMartens  @MattAllington 
Thanks for the replay.

I did exactly like you demonstared.

 

I have a textbox title assiged to the column by using title text and than fx. 

I assigend it by using the column name ("test" in my case) and "first" summerarzion. and still nothing.

 

I even look at the Data columns after selecting the Country and the columns seem to be black too.  

 

 

Super User
Super User

Re: SELECTEDVALUE not working

Hey @Yuval_Marnin ,

 

please create a pbix, that allows to recreated the issue, upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Yuval_Marnin Frequent Visitor
Frequent Visitor

Re: SELECTEDVALUE not working

@TomMartens 

I uploaded the file to one drive.

here is the link

https://1drv.ms/u/s!Apvu9B7DB5Mng0KUCWm8bAJpmkk9

 

I deleted all the unneccery columns to make it simple.

The title of the text box and the bar chart should be change when choosing the country.

 

I am sure it is simple mistake I made but I just can't find it.

Super User
Super User

Re: SELECTEDVALUE not working

Hey,

 

the measure Measure looks like this:

Measure = SELECTEDVALUE(Y2017[Country])

Assigning the this measure to title of the text box like so:

image.png

Creates a report like this:

image.png

Unfortunately the title will of the chart itself will not be updated, not sure if this is a bug or by design. Maybe you want to create an issue.

 

Regards,

Tom

 

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Yuval_Marnin Frequent Visitor
Frequent Visitor

Re: SELECTEDVALUE not working

Great solution, It worked for me as well.

 

Thank you !

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 288 members 3,127 guests
Please welcome our newest community members: