So I'm trying to get the percentage of an item category from my dataset. Let's say I have the following data:
Name | Category | Order Date | Inventory |
Apples | Fruits | 1/1/17 | 100 |
Oranges | Fruits | 1/2/17 | 70 |
Grapes | Fruits | 1/3/17 | 80 |
Apples | Fruits | 1/4/17 | 20 |
Oranges | Fruits | 1/5/17 | 30 |
Given the following data (total = 300), my output would be Apples = 40%, Oranges = 33.3% and Grapes = 26.7%. Will this be a calculated column or a measure? And how?
I took a jab at this and In my actual data, I have 7045 (81.4%) rows of Apples, 1615 (18.6%) rows of Oranges (which amounts to a total of 8660 rows. I tried the following formula:
AS % = COUNT(Sheet1[Name]) / Sheet1[Total Rows]
But I got a value of 100% for both when I filtered the values using the table visualization.