## Percentage Calculation in Metrics Report.

 Author Message sunitarani19 Forum Newbie Group: General Forum Members Points: 1 Visits: 0 Hi All, 12/3/2013 12/4/2013 Measure value percentage value percentageFailed 100 percent 1 200 Delivered 100 percent 2 200 Unknown 100 percent 3 200 Total 300 600 i have a metric report as above and need to calculate the percentage.The Dataset has the following fields - Measure and Value.percent 1 should be calculated as failed/(Unknown+Total) i.e 100/(100+300)Percent 2 should be calculated as delivered/(Unknown+Total) i.e 100/(100+300)Percent 3 should be calculated as Unknown(Unknown+Total) i.e 100/(100+300)This is a metric report not a tabular report.Help Please.ThanksRani Attachments report.JPG (14 views, 26.00 KB) Mark Fitzgerald-331224 Hall of Fame Group: General Forum Members Points: 3979 Visits: 1603 This is a common requirement, to calculate the percentage of total given a list of values.The normal calculation would be : Percentage of Total = ThisValue / TotalYour calculations look strange as the Unknown value is included twice (once in the total and once where you use the Unknown+Total as the divisor).Given the normal requirement in a matrix (columns are Date, Metric and Value).1. Add the matrix to the report as normal (gives 2 by 2 grid)2. Drag the Date column onto the first row, second column. This will repeat for each date and gives a column group called Date which will be used later.3. Drag the Metric column onto the second row, first column. This will repeat for each metric and gives a row group called Metric.4. Drag the Value column on the second row, second column. The expression will be =SUM(Fields!Value.value)5. Test the report shows the values in the correct way.6. In design mode, right click the Value cell and choose to Insert Column inside group to the right. This will be the cell for the percentage.7. Right click the new cell and choose to add an Expression, as below. This would give the total for the complete Date (refers to the column group name).=SUM(Fields!Value.value) / SUM(Fields!Value.value, "Date")8. Format the cell to percentage.9. Right click the Date column heading and choose to Insert Row inside group below. Split the new cell that is created. Name the headings Value and Percentage.DoneFitz(Measure and Percentage.txt is a example RDL) Attachments SampleReport_output.png (17 views, 4.00 KB) Measure and Percentage.txt (10 views, 27.00 KB) MMartin1 Hall of Fame Group: General Forum Members Points: 3819 Visits: 2031 You can also include the percent/ratio in your sql query and pass it as a column to the report via the result set. Example ::`USE ADVENTUREWORKS2008R2;GoSELECT personType, count(*) as Total, round( (cast(count(*) as float)/ (SELECT count(*) from person.person) ),3)*100 as PercentOfTotalfrom person.personGroup by personType`This can help you get started. Make sure count(*) > 0 :-D ----------------------------------------------------How to post forum questions to get the best help