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
brianjwilson
Frequent Visitor

Store selected (highlighted) row from a visual as a value

Hello. I have a table visual where once a user selects (highlights) a row, information will display in other visuals that are blank until a selection is made. I accomplished that by adding a countrows(allselected(<columnname>) measure and then setting a filter =1 on the second set of visuals. That is all working great.

 

I have also created a measure that when displayed in its own standalone table behaves how I need. That measure is selectedvalue(<columnname>, <alternativeresult>). So when no row is selected (highlighted) in the original table visual, the alternative result is displayed. But when a row is selected, the selected value is displayed. That is also working as desired.

 

My problem is that I need to be able to use that selected value in other operations. For example, I would like to use Power Automate to write the selected row to an Excel Online file (i.e. I need to use the selected value as a filter condition for other operations). But that isn't working for me. I've tried adding a calculated column to the original table that calculates the selectedvalue measure, with all sorts of filters, but none of those work because it appears to be getting evaluated at the row level.

 

Is there a way to write that measure value to its own single row table that will work? I've tried a calculated table as well but it seems to still be doing things at the row level and therefore comes up with just a repeat of the original table, rather than the single value of what was selected by the user.

 

Thank you for your help!

4 REPLIES 4
Anonymous
Not applicable

Well I noticed that. But for a couple of reasons, I wanted to have it as its own value. First because I thought it might help with processing speed of the Power Automate flow since the table in question has 1M+ rows. But more importantly because I haven't been able to figure out how to prevent the flow from working when a user hasn't selected a value yet. I don't want the flow to do its thing for the million rows - just for a single selected row. I've played around with trigger conditions on the flow button without success. And I can't use the transparent card trick to hide the button based on a condition because the card will be on top and prevent clicking the button when the condition is met. So my thought was to write the selected value to its own table so that I would then have a single row table to use for the flow.

 

I feel like it must be possible because if I were to place that measure on the canvas in its own visual like a table, it works correctly. But when I place that measure inside the original table it gets evaluated at each row of the visual and then doesn't work correctly. So I was thinking it was just something I wasn't understanding about context that I could work around using a CALCULATE function with the appropriate FILTER condition on the measure, so that I could then use that to create a new single row table. Any ideas for that?

 I haven't been able to figure out how to prevent the flow from working when a user hasn't selected a value yet. I don't want the flow to do its thing for the million rows

You need to handle that scenario in the flow (ie terminate the flow if anything other than one row was submitted). Wasteful, yes, but that is a current fundamental limitation in Power BI.

 

 

lbendlin
Super User
Super User

No need for that. Use the exact same columns in the Power Automate visual as you use in the visual the user is interacting with.  Once they selected a single entry and click on the Power Automate button that filter context will be transferred to Power Automate (ie a single row of data)

Anonymous
Not applicable

Oh, and thank you for your response!

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.