Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
laciodrom_80
Helper IV
Helper IV

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
9 REPLIES 9
rodrigoromaygq
New Member

Hello @laciodrom_80 

Were you able to solve this issue?

I need to get the selected value from a table whose data source = Direct Query. 

As you mention, SELECTEDVALUE, MIN or MAX don't work.

parry2k
Super User
Super User

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@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

@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 .



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@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

@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. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@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

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.