Forum Discussion
Percentiles based on another column
- 5 years ago
Hey laurenspruce
I think I see what you are trying to do here. There are a bunch of ways we could go about doing this. Let me know if this helps.
I am assuming you want to treat each row as a different score so I've included an Index column to make each entry have a unique ID. But as you mentioned you want percentile based on the color and not based on the individual unique row scores.
First we can make a measure that sums the total numerical value
Total Number = SUM(Data[Number])Next we can make our Percentile calculated column.
The Percentile Column = var TheNumber= [Total Number] var TheCalc = CALCULATE(DISTINCTCOUNT(Data[Color]), FILTER(ALL(Data), Data[Number] < TheNumber)) / CALCULATE(DISTINCTCOUNT(Data[Color]), ALL(Data)) + 0 return IF(TheCalc = 0, .01, TheCalc)Now our table will look like this
From here you should be able to select the filters and create the measures you are looking for.
Hey laurenspruce
I think I see what you are trying to do here. There are a bunch of ways we could go about doing this. Let me know if this helps.
I am assuming you want to treat each row as a different score so I've included an Index column to make each entry have a unique ID. But as you mentioned you want percentile based on the color and not based on the individual unique row scores.
First we can make a measure that sums the total numerical value
Total Number =
SUM(Data[Number])
Next we can make our Percentile calculated column.
The Percentile Column =
var TheNumber= [Total Number]
var TheCalc = CALCULATE(DISTINCTCOUNT(Data[Color]), FILTER(ALL(Data), Data[Number] < TheNumber))
/
CALCULATE(DISTINCTCOUNT(Data[Color]), ALL(Data)) + 0
return
IF(TheCalc = 0, .01, TheCalc)
Now our table will look like this
From here you should be able to select the filters and create the measures you are looking for.
- laurenspruce5 years agoRegular Visitor
That seems to have done the job.
Many thanks, really appreciate you taking the time to help me out!