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.
Hi everyone,
currently, the standard visuals and custom visuals in the store do not meet the requirements of my internal customer. I looked around and found out, that we can build custom visuals via R script, which I happily tried out, as in python and R I can make the visuals, which meet the requirement. I have two issues.
Issue 1:
After finally making the visual work, I wanted to filter the visual with slicers, in which case most work. From my observations, those worked, which were loaded directly from the server. But as soon I use calculated columns, I get the following error:
Error Message:
R script error.
Loading required package: xml2
Loading required package: htmlwidgets
Loading required package: ggplot2
Loading required package: lubridate
Attaching package: 'lubridate'
The following objects are masked from 'package:base':
date, intersect, setdiff, union
Loading required package: data.table
Attaching package: 'data.table'
The following objects are masked from 'package:lubridate':
hour, isoweek, mday, minute, month, quarter, second, wday, week,
yday, year
Loading required package: magrittr
Loading required package: plotly
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Error: Discrete value supplied to continuous scale
In addition: There were 12 warnings (use warnings() to see them)
Execution halted
The calculated column is simply looking into Measurements and differentiate if it is the last or one of the many previous measurements.
Is Last Measurement =
SWITCH(
TRUE(),
'[MeasurementInstance] == [MeasurementInstanceTotal],
"Last", "Other"
)
The weird thing is, that "Other" works and the custom visual is filtered, while "Last" doesn't work and give me the above error.
Issue 2:
While it's nice I can select each point in a scatter plot and "zoom" / filter within the visual, I can't affect other visuals e.g. a histogram or a table with some identifiers or cards with some KPIs.
I already looked into the "edit interactions" and all settings for the other visuals are set to "filter", but it doesn't work when I select something inside the r custom visual (made with Plotly).
Scatter Plot is my R custom visual which should filter also the histogram at the left side
After selecting some values within the it zooms in, but will not affect the histogram at the left side
Any ideas on how to solve those two.
Thanks!
did you find a solution for your open point 2? I'm also looking for a solution here.
Hi @boboroo ,
1.The calculated column is static, while the measure is dynamic, so the measure cannot be referenced correctly in the calculated column.
Please change this calculated column to a measure. If you need to be used as a slicer, you need to create the correct calculated column. Please do not reference the measure in the calculated column.
2.MS only provide APIs to support these operations for TypeScript visuals, and not for R.
You may try to package R Code into Power BI Custom Visual.
https://towardsdatascience.com/interactive-power-bi-custom-visuals-with-r-a6a4ac998710
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Could you please give an example on how to do what you described in point 2? I have some R Code that i package to a visual exactly following the way described by the link you provided but even with a build custom R Visual and even after changing the configuration files to accept filters (from the IFilter documentary MS support site) it will not filter my other native visuals to whatever i select in R Custom Visuals (i use R plotly as main library). If needed i can share my project.
The R-Based custom visual can't filter/highlight other visuals unfortunately. This can only be done using the standard custom visuals
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 |
---|---|
17 | |
2 | |
2 | |
1 | |
1 |