joy_1379
joy_1379

Reputation: 499

Campaign performance in Tableau

I am doing campaign analysis in Tableau where I want to see the percentage of leads that has seen 1 campaign,percentage of leads that has seen two campaign and so on in pie chart filter by month and region before they convert to customer.

For e.g in below sample data set there are 5 leads in February of which only lead id abc has seen two campaigns and rest four has seen one campaigns. So the view will be pie chart where 20%(1 out of 5) of lead has seen two campaigns and rest 80% has seen 1 campaigns. If March is selected then pie chart will be 100% one campaign as there is only 1 lead.

If in region filter US is selected then there are three unique leads(abc,efg,klm) in february and view will be pie chart with 33% lead has seen two campaigns and rest two i.e 77% has seen 1 campaign.

I got idea from the link here but not able to do it when month and region filter is added. Campaign analysis in Tableau

enter image description here

Upvotes: 0

Views: 90

Answers (1)

AnilGoyal
AnilGoyal

Reputation: 26238

Just add two calculated fields both LOD, as detailed below-

Campaigns per Lead as

{ FIXED [Lead id] : COUNT([Campaign])}

'Measure_val` as

COUNTD([Lead id]) / ATTR({ FIXED : COUNTD([Lead id])})

Format Measure_val as per cent in number format.

Add your filters to view, add both filters to CONTEXT by right clicking them (Note: In order to have filters calculated before LOD calculation. Normal filter calculates the view after LOD fields are calculated). Check whether filters have been greyed out. Screenshot

Convert Campaign per Lead to dimension by right clicking it.

Add Measure_val to size, angle and text(for label-optional) and Campaign per Lead to color and text(optional again) and you're done.

Desired Output

Do tell if it worked.

Upvotes: 1

Related Questions