7 Replies Latest reply on Dec 15, 2016 4:19 AM by Dhruv Gupta

# Percentage Line chart using 2 measure and 1 Dimension

Hi all,

Can someone help me create a percentage line chart using 2 measure and one dimension.Please refer the attached image containing mock-up data and required chart created in excel.

• ###### 1. Re: Percentage Line chart using 2 measure and 1 Dimension

hi Dhruv,

Yes very possible and very easy in Tableau...can you post the excel of this data (so I don't have to type it up!), and then I can post you a Tableau workbook with an exact solution (can you let me know which Tableau version you are using too)

Thanks

• ###### 2. Re: Percentage Line chart using 2 measure and 1 Dimension

Hi Simon Runc,

Please find attached excel containing the mock data.

Thanks,

Dhruv

• ###### 3. Re: Percentage Line chart using 2 measure and 1 Dimension

Simon, I am using 8.3 version for the development.

Thanks,

Dhruv

• ###### 4. Re: Percentage Line chart using 2 measure and 1 Dimension

Wow 8.3...not use that for a while!!

So as you have literacy rate as a field in your data you can simply add the month to the column shelf and literacy rate to the row shelf, and use the line mark type (Tableau will default to this anyway, as it's generally the best way to look at change over time)

However, I've also created a calculated field to create an aggregated version of Literacy Rate

[Literacy Rate - Calculated]

SUM([Literate Population])/SUM([Total Population])

...the reason this is useful is if you change the level of aggregation. By this I mean if you wanted to look by Quarter or Year, instead of month, your literacy rate field would either SUM (or you could take the average, but not a good idea to average over ratios). By making it an aggregate calculation is will be correct at whatever level you look at. The below example shows what happens if I change the time-aggregation to quarter (notice the small differences in the 2 fields in Q3 and Q4...this is because the non-aggregated version isn't getting weighted)

hope that helps and makes sense

1 of 1 people found this helpful
• ###### 5. Re: Percentage Line chart using 2 measure and 1 Dimension

Thanks Simon,

I did the same but I am not getting the literacy rate in percentage format, it coming like .2193(values between 0-1). Even if i multiply this field with 100 the % sign will be missing. Can you help?

Thanks,

Dhruv

• ###### 6. Re: Percentage Line chart using 2 measure and 1 Dimension

so you just need to change the display formatting...if you right click on the measure and select Default Properties/Number Format, you can change the display to percentage (no need to x100 as the %age format takes this into account)

You can also set the formatting "locally" (i.e. just for the current sheet) by right clicking on the pill (in the sheet) and selecting format, and then setting the format to percentage.

1 of 1 people found this helpful