Forum Discussion
Applying a Percentile on a Graph
- 4 years ago
Hi felixthecatx ,
According to your description, 1045 data, 95 percent, 1045 * 0.95 = 992.75, that is, take the data after 993, if according to my previous method, when more than one duplicate value, may be all selected.
like below:
In my opinion, if you want to reach duplication with only one random peer, you need to create auxiliary index rows to ensure that 5 percent is 1.
insert index:
Then adjust measure to the below:
test1 = VAR RANK1 = RANKX ( ALL ( 'Table' ), CALCULATE ( SUM ( 'Table'[value] )+0.0000001*SUM('Table'[Index]) ) ) VAR MIN1 = CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) ) * 0.05 RETURN IF ( RANK1 <= MIN1, 1, 0 )final:
Best Regards
Lucien
Hi Anonymous ,
Since I don't have your original data of 1045 rows, I created a new template based on what you mentioned, as follows.
The sample have 1045 rows ,then I use the below measure:
test1 =
VAR RANK1 =
RANKX ( ALL ( 'Table'[Date] ), CALCULATE ( SUM ( 'Table'[value] ) ) )
VAR MIN1 =
CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) ) * 0.05
RETURN
IF ( RANK1 <= MIN1, 1, 0 )
Fianal get:(when value start from 994,then return 1)
The first step is to get the first 5 percent of the total, the second step is to sort the values, and then to get the desired data according to the worthy sort and the number of 5 percent.
In your sample ,use the below:
BOTTOM 95% Latency =
VAR __rt = RANKX ( ALL ( 'Data' ), CALCULATE ( SUM ( 'Data'[Actual Days] ) ) )
VAR __95p = CALCULATE ( COUNTROWS ( 'Data' ), ALL ( 'Data' ) ) * 0.05
RETURN
IF(__rt <= __95p, 1, 0)
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi v-luwang-msft . Thanks for your reply. The problem is I have repeating values so this method doesn't grab the right percentage. I am now trying to do something like this (although I haven't gotten this to work yet) -
I have a measure that = 95th percentile of the values column. I'm trying to use that to create a filter. I haven't had luck so far but this is essentially what I am trying =
Filter = IF((Data[Days]) >= [95% Days], 1, 0)- v-luwang-msft4 years agoCommunity Support
Hi felixthecatx ,
According to your description, 1045 data, 95 percent, 1045 * 0.95 = 992.75, that is, take the data after 993, if according to my previous method, when more than one duplicate value, may be all selected.
like below:
In my opinion, if you want to reach duplication with only one random peer, you need to create auxiliary index rows to ensure that 5 percent is 1.
insert index:
Then adjust measure to the below:
test1 = VAR RANK1 = RANKX ( ALL ( 'Table' ), CALCULATE ( SUM ( 'Table'[value] )+0.0000001*SUM('Table'[Index]) ) ) VAR MIN1 = CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) ) * 0.05 RETURN IF ( RANK1 <= MIN1, 1, 0 )final:
Best Regards
Lucien
- Anonymous4 years agoNot applicable
This is great, thank you!