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.
I want to know the value of a selection made in a table, so I can use this in an R script visual.
The end result I'm looking for is to recreate "Highlight" rather than filter. My thinking is that when a user selects a name, I can pass that name to the "col" variable in ggplot, to highlight that data amongst everything else rather than filter to only show that data.
I've played around with SELECTEDVALUE but can't get the logic right. Any ideas?
I'm interested in this exact topic - were you able to find a solution @CheesePlease ?
Hey @CheesePlease ,
unfortunately I don't really understand what you mean by highlight instead of filtering (I'm aware of the functional differenced inside Power BI) and passing selections made to the R script visual.
For this I just can provide a some general guidance, but maybe you already know that as well. The values well of the R script visual passes a table to the R script, this means that just one parameter will be passed to the R script - this parameter will be a data.frame. Basically this table needs to contain all the information to "draw" your visual. I often use measures to combine multiple selections from slicers using the DAX function CONCATENATEX(...). And decompose the string inside the R script.
Regards,
Tom
Hi @TomMartens,
Thanks for your help.
So assume I have data like this:
person | xdata | ydata |
Tom | 2 | 3 |
Ben | 5 | 2 |
Bob | 3 | 4 |
On a "person" table visual, I select Ben. I can get this so that it filters the R visual to only show Ben data, but what I want is to feed to the visual that Ben has been selected, so that I can highlight him in a scatterplot, while keeping the other data.
In this example I've added a third column called "selected" with values F, T, F. I want PowerBi to do something like this automatically when a user clicks on Ben.
dataset = data.frame(person = c("Tom", "Ben", "Bob"),
xdata = c(2,5,3),
ydata = c(3,2,4),
selected = c(F, T, F))
ggplot(dataset) +
geom_point(aes(x = xdata, y = ydata, col = selected))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
69 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |