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

Problem using SELECTEDVALUE in Direct Query mode

Hi guys,

 

I' ve imported in power bi desktop by Direct Query a table (MyTable) and I've created a measure (MyMeasure) to get the column value Column2 when I select a table row:

 

MyMeasure = IF(ISFILTERED(MyTable[Column2]);SELECTEDVALUE(MyTable[Column2]);"No selection")

This measure works fine using Import Mode, while no value is returned by SELECTEDVALUE function in Direct Query modeSmiley Frustrated

 

Any suggestions? How can I fix this in Direct Query?

 

Thanks in advance for any hint

Luca
8 REPLIES 8
Super User
Super User

Re: Problem using SELECTEDVALUE in Direct Query mode

@laciodrom_80 you can use other aggregated function like MAX or MIN to get the value instead of SELECTEDVALUE






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: Problem using SELECTEDVALUE in Direct Query mode

@parry2k I've tried but no value returned also both with MAX and MIN

 

MyMeasure = IF(ISFILTERED(MyTable[Column2]);MAX(MyTable[Column2]);"No selection")
Luca
Super User
Super User

Re: Problem using SELECTEDVALUE in Direct Query mode

@laciodrom_80 not sure why that would be the case. why not just drop a Card Visual and column2 on it (use max) from aggreation and see what result you get. We expect the measure to give the same result .






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: Problem using SELECTEDVALUE in Direct Query mode

@parry2k Card Visual returns Empty value when I select a table row, No selection when I don't select any row

 

No selection:

NoSelection.png

 

First row selected:

Selected.png

 

Vuoto is the italian for empty Smiley Wink

Luca
Super User
Super User

Re: Problem using SELECTEDVALUE in Direct Query mode

@laciodrom_80 so i guess measure is doing the same thing, not fully sure what is going on. very hard to explain. I expected it to return 02149 when you selected first row. 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: Problem using SELECTEDVALUE in Direct Query mode

@parry2k I'm on the horns of a dilemma😠, what kind of limitations are there using measures in direct query mode?
Luca
Super User
Super User

Re: Problem using SELECTEDVALUE in Direct Query mode

@laciodrom_80 hope this helps https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models/dax-formula-compatibility-in-d...






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Re: Problem using SELECTEDVALUE in Direct Query mode

@parry2k  I noticed I have the problem with a sql server on-premises (not installed on my pc), if I try using a sql server on cloud no issue, also using SELECTEDVALUE.

What could be the problem? With Power BI Desktop I don't have to use any gateway, do I ? 

Luca

Helpful resources

Announcements
Community Highlights

Community Highlights

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

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 319 members 3,578 guests
Please welcome our newest community members: