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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pkoppurapu
Frequent Visitor

How to display selected value on table view in direct query mode?

Usage:

I have table view that has multiple columns where users need to scroll right most to get complete information. I was to display the selected row in a text box or a card with all the column details that I want to display.

 

What I tried: 

I tried to use SELECTVALUE(), MAX(), MIN() and VALUE() in a measure to get all the values of each column. But I am getting an empty result although when I place this measure in the same table that I am retrieving data from each row has combined values.

 

For example:

Measure

(SELECTEDVALUE('Table'[Col1])& " - " & SELECTEDVALUE('Table'[Col2]) & " - " &SELECTEDVALUE(Table'[Col3])& " - " & SELECTEDVALUE(Table'[Col4]))

 

Table   Col1   Col2   Col3  Col4   Measure

   1         a        b        c        d     a - b - c - d

   2         x        y        z        r       x - y - z - r

 

Measure is displayed as empty/Blank in a text box. I've tried MAX(), MIN(), and Value().  ===> Direct Query Mode

Please help me with this issue.

Thanks in advance.

4 REPLIES 4
v-kongfanf-msft
Community Support
Community Support

Hi @pkoppurapu ,

 

For direct query mode, you can't view table data in table view, you can only create calculated column to display the result in table visual or create calculated table with the help of addcolumn function. refer below:

vkongfanfmsft_0-1714368437090.png

vkongfanfmsft_1-1714368467782.png

 

Table =
ADDCOLUMNS (
    Table_1,
    "Result",
        Table_1[Col1] & "-" & Table_1[Col2] & "-" & Table_1[Col3]
)

vkongfanfmsft_2-1714368525026.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-kongfanf-msft what if I want to display selected row of a table for a user? Like if a row is selected i want to display the whole row into a text box or a card visual. 
calculated column provides the whole column values into a table.

v-kongfanf-msft
Community Support
Community Support

Hi @pkoppurapu ,

 

I replicated your scenario, connecting to a data source in a direct query. Tried the following formula, which displays the results correctly.

vkongfanfmsft_0-1714356037855.png

 

MEASURE =
SELECTEDVALUE ( Table_1[Col1] ) & "-"
    & SELECTEDVALUE ( Table_1[Col2] ) & "-"
    & SELECTEDVALUE ( Table_1[Col3] )
M_ =
MAX ( Table_1[Col1] ) & "-"
    & MAX ( Table_1[Col2] ) & "-"
    & MAX ( Table_1[Col3] )

vkongfanfmsft_1-1714356054266.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hey @v-kongfanf-msft 

I can see the results in the same table of col1 and col2 but not in a text box/new table. Can you try to print these values in a text box/card/new table? I guess you would face the same issue.

Thank you. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.