Venn Diagram
Thank you so much! Here is my PBIX file.
Also I'vew attached a screen shot of what happens when I change it to a table. Yes the slicer works, but the visual isn't useful anymore.
Many thanks,
Jennifer
Hi Anonymous,
One more tip. You should add more columns to your R visual , so that each row is unique. Otherwise PBI visual (any visual) will remove duplicates and your diagramm will be wrong. Another option is to use ID column. And make sure you do not aggregate fields.
"Do not summarize" for all input fields.
- boefraty8 years agoMicrosoft Employee
Hi Anonymous,
I am glad it worked out for you. Here are limitations of R visuals in PBI:
https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals#known-limitations - Anonymous8 years agoNot applicable
HI Again Boefraty,
I did everything you asked, but now I'm getting a count of one per category. There is a unique id for each observation, but Power Bi is still deleting "duplicates".
Here's the code and output, as well as a screenshot showing the unique ids.
Many, many, many thanks,
Juniper
#set working directory i.e. the folder you are working out of
setwd("H:/Eliel JBBS Sent")
#set default library path - where to look for packages, which are also called libraries
.libPaths("H:/R/win-library/3.4")#load Venn Diagram package
library(VennDiagram)
library("RColorBrewer")
library(grid)
library(futile.logger)
#Venn <- read.xlsx("Venn.xlsx", sheetName = "Venn", header = TRUE, stringsAsFactors = FALSE)
Venn = datasetdraw.triple.venn(margin = 0.1, area1 = nrow(subset(Venn, Felony == "Yes")), area2 = nrow(subset(Venn, Misdemeanor == "Yes")), area3 = nrow(subset(Venn, Ordinance == "Yes")),
n12 = nrow(subset(Venn, Felony == "Yes" & Misdemeanor == "Yes")), n23 = nrow(subset(Venn, Misdemeanor == "Yes" & Ordinance == "Yes")),
n13 = nrow(subset(Venn, Felony == "Yes" & Ordinance == "Yes")), n123 = nrow(subset(Venn, Felony == "Yes" & Misdemeanor == "Yes" & Ordinance == "Yes")),
category = c("Felony Offenders", "Misdemeanor Offenders", "Ordinance Offenders"), lty = "blank", fill = brewer.pal(n = 3, name = "Dark2")) - boefraty8 years agoMicrosoft Employee
Hi Anonymous,
I really need the PBIX to see the problem :(
Sounds like, you added the unique ID to data table, but you did not add the ID column as input to R visual. Drag the ID column to R visual as you did with "Felony" and the rest.
- Anonymous8 years agoNot applicable
Hi Boefraty,
Thank you so much for your patience. Here is the PBIX file.
I dragged the unique ID column to the R visual, but got the same result.
Juniper
- boefraty8 years agoMicrosoft Employee
You missed my "tip" about making sure each column to be "Don't summarize" . Working PBIX with filters is also attached
- Anonymous8 years agoNot applicable
Hi Boefraty,
That's so strange. My file on this end says "don't summarize" is selected. Your code won't run because it doesn't like the (perfectly good) file path, and it says duplicate rows have been removed from the data, which isn't supposed to happen.
Many thanks,
Jennifer
- Anonymous8 years agoNot applicable
Dear Boefraty,
I got it to work! Thanks so much. You have been amazing. I truly appreciate your help and your patience.
Thanks again,
Juniper
- Anonymous8 years agoNot applicable
Hi Boefraty,
How large of a data set can a Venn Diagram handle in Power Bi?
Many thanks,
Juniper
- Anonymous8 years agoNot applicable
Thank you so much!!!
- spotpuff8 years agoFrequent Visitor
This visual appears to give incorrect results when 4 fields are selected.
I can do 3 just fine but 4 doesn't calculate properly, e.g., a category with 30 items shows 20, 4, 0, 0 instead of adding to 30.
My math could be off, though. I think with 4 categories there's no way to actually show the top & bottom categories (or left & right) intersecting since they already overlap in the middle. Maybe that's just a limitation of Venn diagrams; in that case maybe limit it to 3 categories?3 categories: correct figures; each category adds to 8.4 categories: Something is wrong; categories add to 7.
Data is standard 4 variable w/ 2 options per variable. - spotpuff8 years agoFrequent Visitor
The rows are unique; I was using an illustrative example but I was using the diagram on a real dataset which has a row ID type field and I was still having problems with the 4 dimensional Venn diagram.
The issue is likely something to do with more than 3 categories requiring strange diagrams:
https://en.wikipedia.org/wiki/Venn_diagram#Extensions_to_higher_numbers_of_sets
The visual doesn't make the 4th category into that "rainbow" type thing, so the math might be off.
Or I might be wrong.
Either way for now I'm sticking with 3 categories as the math works out in that diagram.