简体   繁体   中英

Google Data Studio bar chart comparing multiple metrics as % of the total

Let's say I have 10 companies that have signed up to my service, and then dropped off. I want to figure out how many of these companies are hitting milestones of usage in my system, so I want a bar chart that shows the data. For instance, I have 2 boolean fields on the companies, "Added Card Details" and "Logged in 3 times".

How do I create a bar chart which shows 2 bars, the % of companies which have that value set to "true", as the example below?

I'm pulling the data from BigQuery, but here's an example table of data to create the graph from:

Name Added Card Details Logged in 3 times
Com1 true true
Com2 true true
Com3 false true
Com4 false true
Com5 false false
Com6 false false
Com7 false false
Com8 false false
Com9 false false
Com10 false false

Should produce a graph which looks like:

示例图

Thanks in advance.

Here's a sheet with example data and an example graph:

https://docs.google.com/spreadsheets/d/12jt1ZlhJ-5Hc8XtQsyXVVnLC1F6GOZz9euZkN2y1jNw/edit?usp=sharing

Here's my attempt at creating the graph. Not sure where to go from here when Dimension has to be declared and only allows one option.

https://datastudio.google.com/reporting/f9a2db1c-2c32-41b6-8e47-1848e2577417

One approach is to use a CONCAT field as the dimension and 2 calculated fields in each of the metrics:

Description Details
Chart : Column Chart
Dimension 1 :
Formula :
Actions
"Actions"
Metric 1 :
Formula :
Type :
Added Card Details
COUNT(IF(Added Card Details = "TRUE", Added Card Details, NULL)) / COUNT(Name)
Number > Percent
Metric 2 :
Formula :
Type :
Logged in 3 times
COUNT(IF(Logged in 3 times = "TRUE", Logged in 3 times, NULL)) / COUNT(Name)
Number > Percent

Publicly editable Google Data Studio report (embedded Google Sheets data source) and an image elaborate:

图表

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM