Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
Canvas has one R visual and several slicers.
In some conditions, dataset will become empty,
so the R visual will show "can't display the visual".
Is it possible display empty like other visuals , or show some messages to warning dataset is null,
because showing "can't display the visual" looks more like a bug than dataset is null.
Thanks in advance!
Daniell
Can you put some IF empty THEN 0 in your undlerlying variables for your R visual?
I'm a rookie of R language, this is how i tried,
but it still shows "Faceting variables must have at least one value"
how should i modify this code?
Thanks!
#dataset <- data.frame( cus_name, amt, year, rank)
if(is.null(dataset))
{
newrow = c("NoData", 1, 2000, 1)
dataset <- rbind(dataset, newrow)
}
I meant not in R but in the underlying data
make yure you always pass something
why is the dataset empty in the first place?
for example, in some year, products' amount is all zero, so the rank will all become 1,
i write a code to identify is whole year's amount zero, if it's true then all rank is blank.
That's why the dataset is empty.
But if i keep zero, then all product will show up, the R visual will become more weird...
R visual can't display empty visual when populating BLANK() values, and re-assign new rows in R script will not work.
In this scenario, you have to assign a non-empty value field. I suggest you make the rank into -1 when whole year's amount is 0. And if you filter with TOP N rank slicer, it will definitely return all products.
Regards,
hi, thanks for your explanation,
I make the rank into -1 instead of blank, then all product will show up, the visual will become like this,
it's the original situation which i tried to avoid....
If it's no way to avoid, i'll consider re-design the whole structure,
Thanks!
User | Count |
---|---|
128 | |
72 | |
70 | |
58 | |
53 |
User | Count |
---|---|
192 | |
96 | |
67 | |
64 | |
54 |