Venn Diagram
Hi Boefraty,
Thank you for your helpful message.
I got the Venn Diagram to work in Power Bi, but I can’t get the slicer to work with it. I’m supposed to do a demonstration on this next week (yikes). I’ve attached a screen shot. Can you give me any tips?
Note: my data file has person-level data (not aggregate), and includes both charge data and demographic data (i.e. race).
Also, I don’t know what a BPIX is.
PBIX is an extension of file generated in PBI desktop .
If you send it to me I will have no trouble to reproduce your problem on my side.
- Anonymous8 years agoNot applicable
Thanks so much!
##This Venn diagram code is for use in the Power Bi demonstration. Run it from R from within Power Bi
#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)
#get Java so we can export to Excel
Sys.setenv(JAVA_HOME = "C:/Program Files/Java/jdk1.8.0_151")library(xlsx)
library(rJava)
Venn <- read.xlsx("Venn.xlsx", sheetName = "Venn", header = TRUE, stringsAsFactors = FALSE)
draw.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
I got your code to run in my PBI Desktop just fine. You mentioned something about slicers. I can not reproduce your slicers from R script :(
Can you attach your PBIX (PBI desktop report file) ?
- Anonymous8 years agoNot applicable
Thanks so much.
Yes, my Venn code works great. The slicer does not.
I created a slicer for Race like I do for anything else in Power Bi (see attached screen shots) It's on the same page as my Venn Diagram, which I created in R. I expected that if I selected only "white" in the race slicer, it would filter out all the non-white subjects in my Venn diagram, just like it does for any other Power Bi visual.
Isn't that how it's supposed to work?
Thanks again,
Jennifer