After some research and tries on my own I haven't been able to fully solve this issue. The problem statement with dummy data is as follows:
I have a variable called "Area" which defines the territory where the car was sold. Another variable is telling me if the car was electric or not. So my dataset would look like this:
I am trying to create a matrix which represents the areas as rows, on column will be the categorical variable and then the count of each category as values; for example, for Europe it will look like this:
I want to calculate a new measure that simply shows me the ratio between electric cars and total of cars by Area; in this case, for europe, the new column will show 40%, which is 2/ (2+3); each measure I attempted created extra more columns, not just one that would calculate this ratio.
Solved! Go to Solution.
Cars sold =
Electric cars sold =
Category = "Electric"
Electric % =
[Electric cars sold],
Then format Electric % as a percentatge to 2 decimals
Hey, thank you for your input. This unfortunately has the same result: it creates a new column for each of the category; I need just one column that has the ratio.
If you don't want the category, can't you just remove it from the columns field of your matrix?
@speedramps has the answer. Just put those three measures (or whatever measures you want) on your table without category on the columns.